]> source.dussan.org Git - nextcloud-server.git/commitdiff
Applied fix from kalassico for "Chiper text must be a string" bug (http://forum.owncl...
authorSam Tuke <samtuke@owncloud.com>
Thu, 31 May 2012 11:25:07 +0000 (12:25 +0100)
committerSam Tuke <samtuke@owncloud.com>
Thu, 31 May 2012 11:25:07 +0000 (12:25 +0100)
apps/files_encryption/lib/crypt.php

index ec27900cbc69bbc99f65e4317592ec1ee9c38c34..d2b8ad145aed4032c41853de53351fb3d0c19ab3 100644 (file)
@@ -43,16 +43,23 @@ class OC_Crypt {
                self::init($params['uid'],$params['password']);
        }
 
-       public static function init($login,$password) {
-               $view=new OC_FilesystemView('/'.$login);
-               OC_FileProxy::$enabled=false;
-               if(!$view->file_exists('/encryption.key')){// does key exist?
-                       OC_Crypt::createkey($login,$password);
-               }
-               $key=$view->file_get_contents('/encryption.key');
-               OC_FileProxy::$enabled=true;
-               $_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
-       }
+       public static function init($login,$password) {      
+          $view1=new OC_FilesystemView('/');
+          if(!$view1->file_exists('/'.$login)){
+             $view1->mkdir('/'.$login);
+          }
+
+          $view=new OC_FilesystemView('/'.$login);      
+          
+          OC_FileProxy::$enabled=false;
+          if(!$view->file_exists('/encryption.key')){// does key exist?
+             OC_Crypt::createkey($login,$password);
+          }
+          $key=$view->file_get_contents('/encryption.key');
+          OC_FileProxy::$enabled=true;
+          $_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
+       }
+
 
        /**
         * get the blowfish encryption handeler for a key