summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
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:35:12 +0200
commit6707e4187e4c1186eff8dfe06999c4539ab80de7 (patch)
treef02fdba025600be5a9928097af0bcb61798df3b0 /apps/files_encryption
parent56de98ed8cb74cc197d5b7cecdc519c2c267e3a5 (diff)
downloadnextcloud-server-6707e4187e4c1186eff8dfe06999c4539ab80de7.tar.gz
nextcloud-server-6707e4187e4c1186eff8dfe06999c4539ab80de7.zip
only use 1 fsview when initializing encryption
Diffstat (limited to 'apps/files_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 1c90954cec8..849e88ee0b2 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);
}