diff options
author | Sam Tuke <samtuke@owncloud.com> | 2012-05-31 12:25:07 +0100 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2012-05-31 12:25:07 +0100 |
commit | e93bb5135d0d12d3811f8c1eeaf162a613a3d98d (patch) | |
tree | e71cc6c28d53c9900d2465ee9684c52a528a89cc /apps/files_encryption | |
parent | 3b36a9b704339b409c1065e843d33e3b8c8dc213 (diff) | |
download | nextcloud-server-e93bb5135d0d12d3811f8c1eeaf162a613a3d98d.tar.gz nextcloud-server-e93bb5135d0d12d3811f8c1eeaf162a613a3d98d.zip |
Applied fix from kalassico for "Chiper text must be a string" bug (http://forum.owncloud.org/viewtopic.php?f=3&t=2586&p=5094)
Diffstat (limited to 'apps/files_encryption')
-rw-r--r-- | apps/files_encryption/lib/crypt.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php index ec27900cbc6..d2b8ad145ae 100644 --- a/apps/files_encryption/lib/crypt.php +++ b/apps/files_encryption/lib/crypt.php @@ -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 |