]> source.dussan.org Git - nextcloud-server.git/commitdiff
actually check the correct password when changing the password
authorRobin Appelman <icewind1991@gmail.com>
Sat, 24 Sep 2011 23:06:00 +0000 (01:06 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 24 Sep 2011 23:06:00 +0000 (01:06 +0200)
settings/ajax/changepassword.php

index 2a8e428fde4be91d5e48bd06752cbe7551201f5e..98218b9f89ea2adebe35efc13a7d3ae2f5ead315 100644 (file)
@@ -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();
 }