closes #1710, closes #1700

v1.18.x
barisusakli 11 years ago
parent db3523b10b
commit 2479a34c56

@ -3,7 +3,7 @@
"no_notifs": "You have no new notifications",
"see_all": "See all Notifications",
"back_to_home": "Back to NodeBB",
"back_to_home": "Back to %1",
"outgoing_link": "Outgoing Link",
"outgoing_link_message": "You are now leaving",
"continue_to": "Continue to",

@ -13,6 +13,7 @@ apiController.getConfig = function(req, res, next) {
var config = {};
config.relative_path = serverConfig.relative_path;
config.version = pkg.version;
config.siteTitle = meta.config.title || meta.config.browserTitle || 'NodeBB';
config.postDelay = meta.config.postDelay;
config.minimumTitleLength = meta.config.minimumTitleLength;
config.maximumTitleLength = meta.config.maximumTitleLength;

@ -155,22 +155,29 @@ var bcrypt = require('bcryptjs'),
},
exists: function(next) {
db.exists('user:' + uid, next);
},
isAdmin: function(next) {
User.isAdministrator(uid, next);
}
}, function(err, results) {
if (err) {
return callback(err);
}
if (!results.exists) {
return callback(new Error('[[error:no-user]]'));
}
if (results.isAdmin) {
return callback();
}
var userData = results.userData;
if (parseInt(userData.banned, 10) === 1) {
return callback(new Error('[[error:user-banned]]'));
}
if (!results.exists) {
return callback(new Error('[[error:no-user]]'));
}
if (userData.email && parseInt(meta.config.requireEmailConfirmation, 10) === 1 && parseInt(userData['email:confirmed'], 10) !== 1) {
return callback(new Error('[[error:email-not-confirmed]]'));
}

Loading…
Cancel
Save