diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-09-25 01:06:00 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-09-25 01:06:00 +0200 |
commit | c16a9a83ba4410d969f60772c29ac48ee2116c01 (patch) | |
tree | 8cc5b78a4ff66a3c869d3c0aa6dd01cded169e6e /settings/ajax | |
parent | 09092dd2d261d8fc31f424241f3cf87f0bb9bf88 (diff) | |
download | nextcloud-server-c16a9a83ba4410d969f60772c29ac48ee2116c01.tar.gz nextcloud-server-c16a9a83ba4410d969f60772c29ac48ee2116c01.zip |
actually check the correct password when changing the password
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/changepassword.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 2a8e428fde4..98218b9f89e 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -8,9 +8,10 @@ header( "Content-Type: application/jsonrequest" ); $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser(); $password = $_POST["password"]; +$oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:''; // Check if we are a user -if( !OC_User::isLoggedIn() || (!OC_Group::inGroup( OC_User::getUser(), 'admin' ) && ($username!=OC_User::getUser() || !OC_User::checkPassword($username,$password)))) { +if( !OC_User::isLoggedIn() || (!OC_Group::inGroup( OC_User::getUser(), 'admin' ) && ($username!=OC_User::getUser() || !OC_User::checkPassword($username,$oldPassword)))) { echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" ))); exit(); } |