mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
closes #2560
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
"email-taken": "Email taken",
|
||||
"email-not-confirmed": "Your email has not been confirmed yet, please click here to confirm your email.",
|
||||
"email-not-confirmed-chat": "You are unable to chat until your email is confirmed",
|
||||
"no-email-to-confirm": "This forum requires email confirmation, please click here to enter an email",
|
||||
|
||||
"username-too-short": "Username too short",
|
||||
"username-too-long": "Username too long",
|
||||
|
||||
@@ -570,7 +570,21 @@ app.cacheBuster = null;
|
||||
};
|
||||
|
||||
function showEmailConfirmWarning() {
|
||||
if (config.requireEmailConfirmation && app.user.uid && !app.user['email:confirmed']) {
|
||||
if (!config.requireEmailConfirmation || !app.user.uid) {
|
||||
return;
|
||||
}
|
||||
if (!app.user.email) {
|
||||
app.alert({
|
||||
alert_id: 'email_confirm',
|
||||
message: '[[error:no-email-to-confirm]]',
|
||||
type: 'warning',
|
||||
timeout: 0,
|
||||
clickfn: function() {
|
||||
app.removeAlert('email_confirm');
|
||||
ajaxify.go('user/' + app.user.userslug + '/edit');
|
||||
}
|
||||
});
|
||||
} else if (!app.user['email:confirmed']) {
|
||||
app.alert({
|
||||
alert_id: 'email_confirm',
|
||||
message: '[[error:email-not-confirmed]]',
|
||||
|
||||
@@ -317,7 +317,7 @@ middleware.renderHeader = function(req, res, callback) {
|
||||
},
|
||||
user: function(next) {
|
||||
if (uid) {
|
||||
user.getUserFields(uid, ['username', 'userslug', 'picture', 'status', 'email:confirmed', 'banned'], next);
|
||||
user.getUserFields(uid, ['username', 'userslug', 'email', 'picture', 'status', 'email:confirmed', 'banned'], next);
|
||||
} else {
|
||||
next(null, {
|
||||
username: '[[global:guest]]',
|
||||
@@ -342,7 +342,7 @@ middleware.renderHeader = function(req, res, callback) {
|
||||
results.user.isAdmin = results.isAdmin || false;
|
||||
results.user.uid = parseInt(results.user.uid, 10);
|
||||
results.user['email:confirmed'] = parseInt(results.user['email:confirmed'], 10) === 1;
|
||||
|
||||
|
||||
templateValues.browserTitle = results.title;
|
||||
templateValues.isAdmin = results.user.isAdmin;
|
||||
templateValues.user = results.user;
|
||||
|
||||
Reference in New Issue
Block a user