From: Robin Appelman Date: Sat, 24 Sep 2011 23:06:00 +0000 (+0200) Subject: actually check the correct password when changing the password X-Git-Tag: v3.0~149 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c16a9a83ba4410d969f60772c29ac48ee2116c01;p=nextcloud-server.git actually check the correct password when changing the password --- 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(); }