aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/hooks
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-10 12:12:07 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-06-10 12:12:07 +0200
commit13017ce9e114d84ba9b4ced240e5648447fdfe45 (patch)
tree5a4ae7b311319a239d9c6792cefc879b5558d1cc /apps/files_encryption/hooks
parentb25ab94a08ab9ba5e322043ac470d5352d456c71 (diff)
parentdb06b906e50d7d1b7eca28f51db913af1fbc81f1 (diff)
downloadnextcloud-server-13017ce9e114d84ba9b4ced240e5648447fdfe45.tar.gz
nextcloud-server-13017ce9e114d84ba9b4ced240e5648447fdfe45.zip
Merge branch 'master' into files_encryption_check_private_key
Conflicts: settings/ajax/changepassword.php
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r--apps/files_encryption/hooks/hooks.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index cfe9e9d2a32..4434df8f147 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -46,6 +46,11 @@ class Hooks {
$view = new \OC_FilesystemView('/');
+ // ensure filesystem is loaded
+ if(!\OC\Files\Filesystem::$loaded) {
+ \OC_Util::setupFS($params['uid']);
+ }
+
$util = new Util($view, $params['uid']);
// setup user, if user not ready force relogin
@@ -142,6 +147,15 @@ class Hooks {
}
/**
+ * @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
*/