run setup routine only for server side encryption
This commit is contained in:
parent
bb229f7291
commit
931c4695a6
|
@ -34,21 +34,25 @@ class Hooks {
|
||||||
* @brief Startup encryption backend upon user login
|
* @brief Startup encryption backend upon user login
|
||||||
* @note This method should never be called for users using client side encryption
|
* @note This method should never be called for users using client side encryption
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static function login( $params ) {
|
public static function login( $params ) {
|
||||||
|
|
||||||
|
if (Crypt::mode($params['uid'])=='server') {
|
||||||
|
|
||||||
$view = new \OC_FilesystemView( '/' );
|
$view = new \OC_FilesystemView( '/' );
|
||||||
|
|
||||||
$util = new Util( $view, $params['uid'] );
|
$util = new Util( $view, $params['uid'] );
|
||||||
|
|
||||||
if ( !$util->ready()) {
|
if ( !$util->ready()) {
|
||||||
|
|
||||||
return $util->setup( $params['password'] );
|
return $util->setupServerSide( $params['password'] );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$encryptedKey = Keymanager::getPrivateKey( $params['uid'] );
|
$encryptedKey = Keymanager::getPrivateKey( $params['uid'] );
|
||||||
|
|
||||||
$_SESSION['enckey'] = Crypt::symmetricEncryptFileContent( $encryptedKey, $params['password'] );
|
$_SESSION['enckey'] = Crypt::symmetricEncryptFileContent( $encryptedKey, $params['password'] );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue