mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
fix: added missing translation and error state for password change
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
"change_picture": "Change Picture",
|
"change_picture": "Change Picture",
|
||||||
"change_username": "Change Username",
|
"change_username": "Change Username",
|
||||||
"change_email": "Change Email",
|
"change_email": "Change Email",
|
||||||
|
"email_same_as_password": "Please enter your current password to continue – you've entered your new email again",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
"edit-profile": "Edit Profile",
|
"edit-profile": "Edit Profile",
|
||||||
"default_picture": "Default Icon",
|
"default_picture": "Default Icon",
|
||||||
|
|||||||
@@ -8,10 +8,11 @@ define('forum/account/edit/email', ['forum/account/header'], function (header) {
|
|||||||
header.init();
|
header.init();
|
||||||
|
|
||||||
$('#submitBtn').on('click', function () {
|
$('#submitBtn').on('click', function () {
|
||||||
|
var curPasswordEl = $('#inputCurrentPassword');
|
||||||
var userData = {
|
var userData = {
|
||||||
uid: $('#inputUID').val(),
|
uid: $('#inputUID').val(),
|
||||||
email: $('#inputNewEmail').val(),
|
email: $('#inputNewEmail').val(),
|
||||||
password: $('#inputCurrentPassword').val(),
|
password: curPasswordEl.val(),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!userData.email) {
|
if (!userData.email) {
|
||||||
@@ -19,6 +20,7 @@ define('forum/account/edit/email', ['forum/account/header'], function (header) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userData.email === userData.password) {
|
if (userData.email === userData.password) {
|
||||||
|
curPasswordEl.parents('.control-group').toggleClass('has-error', true);
|
||||||
return app.alertError('[[user:email_same_as_password]]');
|
return app.alertError('[[user:email_same_as_password]]');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user