Skip to content
Snippets Groups Projects
Commit f1a5b8b5 authored by Björn Schießle's avatar Björn Schießle
Browse files

show nicer warning if the admin recovery password was wrong

parent 8ae30891
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ if(is_null($userstatus)) {
$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), \OCP\User::getUser());
if ( $recoveryPassword && ! $util->checkRecoveryPassword($recoveryPassword) ) {
OC_JSON::error(array("data" => array( "message" => "Wrong recovery admin password. Please check the password and try again." )));
OC_JSON::error(array("data" => array( "message" => "Wrong admin recovery password. Please check the password and try again." )));
}elseif(!is_null($password) && OC_User::setPassword( $username, $password, $recoveryPassword )) {
OC_JSON::success(array("data" => array( "username" => $username )));
}
......
......@@ -351,15 +351,13 @@ $(document).ready(function () {
input.keypress(function (event) {
if (event.keyCode == 13) {
if ($(this).val().length > 0) {
var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val();
console.log("RECOVERY PASSWD: " + recoveryPasswordVal);
var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val();
$.post(
OC.filePath('settings', 'ajax', 'changepassword.php'),
{username: uid, password: $(this).val(), recoveryPassword: recoveryPasswordVal},
function (result) {
if (result.status != 'success') {
OC.dialogs.alert(result.data.message,
t('settings', 'Error changing password'));
OC.Notification.show(t('admin', result.data.message));
}
}
);
......@@ -374,6 +372,10 @@ $(document).ready(function () {
img.css('display', '');
});
});
$('input:password[id="recoveryPassword"]').keyup(function(event) {
OC.Notification.hide();
});
$('table').on('click', 'td.password', function (event) {
$(this).children('img').click();
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment