|
|
@ -169,10 +169,9 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
confirmBtn.html('<i class="fa fa-spinner fa-spin"></i>');
|
|
|
|
confirmBtn.html('<i class="fa fa-spinner fa-spin"></i>');
|
|
|
|
confirmBtn.prop('disabled', true);
|
|
|
|
confirmBtn.prop('disabled', true);
|
|
|
|
|
|
|
|
|
|
|
|
socket.emit('user.checkPassword', {
|
|
|
|
socket.emit('user.deleteAccount', {
|
|
|
|
uid: parseInt(ajaxify.data.uid, 10),
|
|
|
|
|
|
|
|
password: $('#confirm-password').val(),
|
|
|
|
password: $('#confirm-password').val(),
|
|
|
|
}, function (err, ok) {
|
|
|
|
}, function (err) {
|
|
|
|
function restoreButton() {
|
|
|
|
function restoreButton() {
|
|
|
|
translator.translate('[[modules:bootbox.confirm]]', function (confirmText) {
|
|
|
|
translator.translate('[[modules:bootbox.confirm]]', function (confirmText) {
|
|
|
|
confirmBtn.text(confirmText);
|
|
|
|
confirmBtn.text(confirmText);
|
|
|
@ -183,20 +182,11 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
restoreButton();
|
|
|
|
restoreButton();
|
|
|
|
return app.alertError(err.message);
|
|
|
|
return app.alertError(err.message);
|
|
|
|
} else if (!ok) {
|
|
|
|
|
|
|
|
restoreButton();
|
|
|
|
|
|
|
|
return app.alertError('[[error:invalid-password]]');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
confirmBtn.html('<i class="fa fa-check"></i>');
|
|
|
|
confirmBtn.html('<i class="fa fa-check"></i>');
|
|
|
|
socket.emit('user.deleteAccount', {}, function (err) {
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
return app.alertError(err.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.location.href = config.relative_path + '/';
|
|
|
|
window.location.href = config.relative_path + '/';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|