From d7a9852f7b1ea7999f730fde8bd9816da68dad8b Mon Sep 17 00:00:00 2001 From: Björn Schießle Date: Thu, 6 Jun 2013 13:32:02 +0200 Subject: use pre_setPassword hook to update the encryption keys if the back-end doesn't support password change; improved output to let the admin know what happened --- apps/files_encryption/hooks/hooks.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/files_encryption/hooks') diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index d1b08a0b978..c4b247da1ed 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -141,6 +141,15 @@ class Hooks { \OC_FileProxy::$enabled = $proxyStatus; } + /** + * @brief If the password can't be changed within ownCloud, than update the key password in advance. + */ + public static function preSetPassphrase($params) { + if ( ! \OC_User::canUserChangePassword($params['uid']) ) { + self::setPassphrase($params); + } + } + /** * @brief Change a user's encryption passphrase * @param array $params keys: uid, password -- cgit v1.2.3