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-taken": "Email taken",
|
||||||
"email-not-confirmed": "Your email has not been confirmed yet, please click here to confirm your email.",
|
"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",
|
"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-short": "Username too short",
|
||||||
"username-too-long": "Username too long",
|
"username-too-long": "Username too long",
|
||||||
|
|||||||
@@ -570,7 +570,21 @@ app.cacheBuster = null;
|
|||||||
};
|
};
|
||||||
|
|
||||||
function showEmailConfirmWarning() {
|
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({
|
app.alert({
|
||||||
alert_id: 'email_confirm',
|
alert_id: 'email_confirm',
|
||||||
message: '[[error:email-not-confirmed]]',
|
message: '[[error:email-not-confirmed]]',
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ middleware.renderHeader = function(req, res, callback) {
|
|||||||
},
|
},
|
||||||
user: function(next) {
|
user: function(next) {
|
||||||
if (uid) {
|
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 {
|
} else {
|
||||||
next(null, {
|
next(null, {
|
||||||
username: '[[global:guest]]',
|
username: '[[global:guest]]',
|
||||||
|
|||||||
Reference in New Issue
Block a user