mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: show instructional modal after email change request
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
define('forum/account/profile', [
|
define('forum/account/profile', [
|
||||||
'forum/account/header',
|
'forum/account/header',
|
||||||
'components',
|
'bootbox',
|
||||||
], function (header) {
|
], function (header, bootbox) {
|
||||||
var Account = {};
|
var Account = {};
|
||||||
|
|
||||||
Account.init = function () {
|
Account.init = function () {
|
||||||
@@ -14,6 +14,10 @@ define('forum/account/profile', [
|
|||||||
|
|
||||||
processPage();
|
processPage();
|
||||||
|
|
||||||
|
if (parseInt(ajaxify.data.emailChanged, 10) === 1) {
|
||||||
|
bootbox.alert('[[user:emailUpdate.change-instructions]]');
|
||||||
|
}
|
||||||
|
|
||||||
socket.removeListener('event:user_status_change', onUserStatusChange);
|
socket.removeListener('event:user_status_change', onUserStatusChange);
|
||||||
socket.on('event:user_status_change', onUserStatusChange);
|
socket.on('event:user_status_change', onUserStatusChange);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ profileController.get = async function (req, res, next) {
|
|||||||
userData.title = userData.username;
|
userData.title = userData.username;
|
||||||
userData.allowCoverPicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:cover-picture'];
|
userData.allowCoverPicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:cover-picture'];
|
||||||
|
|
||||||
|
// Show email changed modal on first access after said change
|
||||||
|
userData.emailChanged = req.session.emailChanged;
|
||||||
|
delete req.session.emailChanged;
|
||||||
|
|
||||||
if (!userData.profileviews) {
|
if (!userData.profileviews) {
|
||||||
userData.profileviews = 1;
|
userData.profileviews = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ Interstitials.email = async (data) => {
|
|||||||
email: formData.email,
|
email: formData.email,
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
|
data.req.session.emailChanged = 1;
|
||||||
} else {
|
} else {
|
||||||
// User attempting to edit another user's email -- not allowed
|
// User attempting to edit another user's email -- not allowed
|
||||||
throw new Error('[[error:no-privileges]]');
|
throw new Error('[[error:no-privileges]]');
|
||||||
|
|||||||
Reference in New Issue
Block a user