mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
@@ -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;
|
||||
|
||||
15
src/user.js
15
src/user.js
@@ -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]]'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user