show nicer warning if the admin recovery password was wrong
This commit is contained in:
parent
8ae30891b3
commit
f1a5b8b524
2 changed files with 7 additions and 5 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue