diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index 5d94497ce58..5eab751b04e 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -10,6 +10,7 @@ OC_JSON::verifyUser(); $username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser(); $password = $_POST["password"]; +$oldPassword=isset($_POST["oldpassword"])?$_POST["oldpassword"]:''; $userstatus = null; if(OC_Group::inGroup(OC_User::getUser(), 'admin')) { @@ -18,7 +19,7 @@ if(OC_Group::inGroup(OC_User::getUser(), 'admin')) { if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) { $userstatus = 'subadmin'; } -if(OC_User::getUser() == $username) { +if(OC_User::getUser() == $username && OC_User::checkPassword($username, $oldPassword)) { $userstatus = 'user'; } diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 0683bd3b64f..55ff24b4223 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -18,8 +18,9 @@
t('Your password was changed');?>
t('Unable to change your password');?>
- - + + +