Skip to content
Snippets Groups Projects
Commit e93bb513 authored by Sam Tuke's avatar Sam Tuke
Browse files

Applied fix from kalassico for "Chiper text must be a string" bug...

Applied fix from kalassico for "Chiper text must be a string" bug (http://forum.owncloud.org/viewtopic.php?f=3&t=2586&p=5094)
parent 3b36a9b7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment