only use 1 fsview when initializing encryption
This commit is contained in:
parent
da9107fe69
commit
bd8b921de4
|
@ -44,18 +44,16 @@ class OC_Crypt {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function init($login,$password) {
|
public static function init($login,$password) {
|
||||||
$view1=new OC_FilesystemView('/');
|
$view=new OC_FilesystemView('/');
|
||||||
if(!$view1->file_exists('/'.$login)){
|
if(!$view->file_exists('/'.$login)){
|
||||||
$view1->mkdir('/'.$login);
|
$view->mkdir('/'.$login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$view=new OC_FilesystemView('/'.$login);
|
|
||||||
|
|
||||||
OC_FileProxy::$enabled=false;
|
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);
|
OC_Crypt::createkey($login,$password);
|
||||||
}
|
}
|
||||||
$key=$view->file_get_contents('/encryption.key');
|
$key=$view->file_get_contents('/'.$login.'/encryption.key');
|
||||||
OC_FileProxy::$enabled=true;
|
OC_FileProxy::$enabled=true;
|
||||||
$_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
|
$_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue