diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-13 22:34:11 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-13 22:34:11 +0200 |
commit | b2d021b2a5a603505c6c0e607472ee4e91962afe (patch) | |
tree | 2b3dec43adb152cf31fd823e969b25f894363bee /apps/files_encryption/hooks | |
parent | 61ed347d26872bc62465be4df595da3391ea84bb (diff) | |
download | nextcloud-server-b2d021b2a5a603505c6c0e607472ee4e91962afe.tar.gz nextcloud-server-b2d021b2a5a603505c6c0e607472ee4e91962afe.zip |
added post_createUser hook
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 71a0fc9268b..ebaa9c51452 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -47,17 +47,11 @@ class Hooks { $view = new \OC_FilesystemView( '/' );
$util = new Util( $view, $params['uid'] );
-
- // Check files_encryption infrastructure is ready for action
- if ( ! $util->ready() ) {
-
- \OC_Log::write( 'Encryption library', 'User account "' . $params['uid'] . '" is not ready for encryption; configuration started', \OC_Log::DEBUG );
-
- if(!$util->setupServerSide( $params['password'] )) {
- return false;
- }
- }
+ // setup user, if user not ready force relogin
+ if(Helper::setupUser($util, $params['password']) === false) {
+ return false;
+ }
\OC_FileProxy::$enabled = false;
@@ -120,8 +114,20 @@ class Hooks { return true;
}
-
- /**
+
+ /**
+ * @brief setup encryption backend upon user created
+ * @note This method should never be called for users using client side encryption
+ */
+ public static function postCreateUser( $params ) {
+ $view = new \OC_FilesystemView( '/' );
+
+ $util = new Util( $view, $params['uid'] );
+
+ Helper::setupUser($util, $params['password']);
+ }
+
+ /**
* @brief Change a user's encryption passphrase
* @param array $params keys: uid, password
*/
|