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 /settings/ajax/changepassword.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 'settings/ajax/changepassword.php')
-rw-r--r-- | settings/ajax/changepassword.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 4f16bff63d5..fe63f27a6e2 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -8,8 +8,9 @@ OC_JSON::checkLoggedIn(); OC_APP::loadApps(); $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser(); -$password = isset($_POST["newpassword"]) ? $_POST["newpassword"] : null; +$password = isset($_POST["password"]) ? $_POST["password"] : null; $oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:''; +$recoveryPassword=isset($_POST["recoveryPassword"])?$_POST["recoveryPassword"]:null; $userstatus = null; if(OC_User::isAdminUser(OC_User::getUser())) { @@ -28,7 +29,7 @@ if(is_null($userstatus)) { } // Return Success story -if(!is_null($password) && OC_User::setPassword( $username, $password )) { +if(!is_null($password) && OC_User::setPassword( $username, $password, $recoveryPassword )) { OC_JSON::success(array("data" => array( "username" => $username ))); } else{ |