summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-21 18:35:12 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-21 18:36:16 +0200
commitbd8b921de4dac02463fa5b0099a22db4c45cd4f8 (patch)
treea0354130bae806cd64555f279694cb9a8967c66e
parentda9107fe699e6e5dfe0df8921484178fee844f4c (diff)
downloadnextcloud-server-bd8b921de4dac02463fa5b0099a22db4c45cd4f8.tar.gz
nextcloud-server-bd8b921de4dac02463fa5b0099a22db4c45cd4f8.zip
only use 1 fsview when initializing encryption
-rw-r--r--apps/files_encryption/lib/crypt.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 12be5aefcb0..7d39d926678 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -44,18 +44,16 @@ class OC_Crypt {
}
public static function init($login,$password) {
- $view1=new OC_FilesystemView('/');
- if(!$view1->file_exists('/'.$login)){
- $view1->mkdir('/'.$login);
+ $view=new OC_FilesystemView('/');
+ if(!$view->file_exists('/'.$login)){
+ $view->mkdir('/'.$login);
}
- $view=new OC_FilesystemView('/'.$login);
-
OC_FileProxy::$enabled=false;
- if(!$view->file_exists('/encryption.key')){// does key exist?
+ if(!$view->file_exists('/'.$login.'/encryption.key')){// does key exist?
OC_Crypt::createkey($login,$password);
}
- $key=$view->file_get_contents('/encryption.key');
+ $key=$view->file_get_contents('/'.$login.'/encryption.key');
OC_FileProxy::$enabled=true;
$_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
}