Skip to content

Node.js based forum software built for the modern web

closes #1710, closes #1700

barisusakli2479a34c56ed
diff --git a/public/language/en_GB/notifications.json b/public/language/en_GB/notifications.json
index 10f56b6cfc..c6e16c9f55 100644
--- a/public/language/en_GB/notifications.json
+++ b/public/language/en_GB/notifications.json
@@ -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",
diff --git a/src/controllers/api.js b/src/controllers/api.js
index ef355cbd51..78140bae9d 100644
--- a/src/controllers/api.js
+++ b/src/controllers/api.js
@@ -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;
diff --git a/src/user.js b/src/user.js
index e751b5b69e..36e6e9e862 100644
--- a/src/user.js
+++ b/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]]'));
}