diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-05-16 14:53:04 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-05-16 14:53:04 +0200 |
commit | 9d1e60325c6f478484ff8f70ff3cd13d9d7d4913 (patch) | |
tree | 3c341c7c65af8de027ade37a72fc4208355a41df /lib/user.php | |
parent | 67a80e1870a47c0f060c58f65b3a6fc838c52b70 (diff) | |
download | nextcloud-server-9d1e60325c6f478484ff8f70ff3cd13d9d7d4913.tar.gz nextcloud-server-9d1e60325c6f478484ff8f70ff3cd13d9d7d4913.zip |
allow admin to recover users files in case of password lost
Diffstat (limited to 'lib/user.php')
-rw-r--r-- | lib/user.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/user.php b/lib/user.php index 226b716188d..833e8866592 100644 --- a/lib/user.php +++ b/lib/user.php @@ -393,13 +393,14 @@ class OC_User { * @brief Set password * @param $uid The username * @param $password The new password + * @param $recoveryPassword for the encryption app to reset encryption keys * @returns true/false * * Change the password of a user */ - public static function setPassword( $uid, $password ) { + public static function setPassword( $uid, $password, $recoveryPassword = null ) { $run = true; - OC_Hook::emit( "OC_User", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password )); + OC_Hook::emit( "OC_User", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password, "recoveryPassword" => $recoveryPassword )); if( $run ) { $success = false; @@ -412,7 +413,7 @@ class OC_User { } // invalidate all login cookies OC_Preferences::deleteApp($uid, 'login_token'); - OC_Hook::emit( "OC_User", "post_setPassword", array( "uid" => $uid, "password" => $password )); + OC_Hook::emit( "OC_User", "post_setPassword", array( "uid" => $uid, "password" => $password, "recoveryPassword" => $recoveryPassword )); return $success; } else{ |