]> source.dussan.org Git - nextcloud-server.git/commitdiff
check for old password when changing passwords
authorRobin Appelman <icewind1991@gmail.com>
Sat, 24 Sep 2011 23:01:39 +0000 (01:01 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Sat, 24 Sep 2011 23:02:22 +0000 (01:02 +0200)
settings/ajax/changepassword.php

index c5cdbcef05610bb4a32559284d01c6eb116824b2..2a8e428fde4be91d5e48bd06752cbe7551201f5e 100644 (file)
@@ -10,7 +10,7 @@ $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
 $password = $_POST["password"];
 
 // Check if we are a user
-if( !OC_User::isLoggedIn() || (!OC_Group::inGroup( OC_User::getUser(), 'admin' )&& $username!=OC_User::getUser())) {
+if( !OC_User::isLoggedIn() || (!OC_Group::inGroup( OC_User::getUser(), 'admin' ) && ($username!=OC_User::getUser() || !OC_User::checkPassword($username,$password)))) {
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }