mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
allow global mods to still login locally as well as admins if disabled in ACP
This commit is contained in:
@@ -380,8 +380,8 @@ authenticationController.localLogin = function (req, username, password, next) {
|
|||||||
userData: function (next) {
|
userData: function (next) {
|
||||||
db.getObjectFields('user:' + uid, ['password', 'passwordExpiry'], next);
|
db.getObjectFields('user:' + uid, ['password', 'passwordExpiry'], next);
|
||||||
},
|
},
|
||||||
isAdmin: function (next) {
|
isAdminOrGlobalMod: function (next) {
|
||||||
user.isAdministrator(uid, next);
|
user.isAdminOrGlobalMod(uid, next);
|
||||||
},
|
},
|
||||||
banned: function (next) {
|
banned: function (next) {
|
||||||
user.isBanned(uid, next);
|
user.isBanned(uid, next);
|
||||||
@@ -391,9 +391,9 @@ authenticationController.localLogin = function (req, username, password, next) {
|
|||||||
function (result, next) {
|
function (result, next) {
|
||||||
userData = result.userData;
|
userData = result.userData;
|
||||||
userData.uid = uid;
|
userData.uid = uid;
|
||||||
userData.isAdmin = result.isAdmin;
|
userData.isAdminOrGlobalMod = result.isAdminOrGlobalMod;
|
||||||
|
|
||||||
if (!result.isAdmin && parseInt(meta.config.allowLocalLogin, 10) === 0) {
|
if (!result.isAdminOrGlobalMod && parseInt(meta.config.allowLocalLogin, 10) === 0) {
|
||||||
return next(new Error('[[error:local-login-disabled]]'));
|
return next(new Error('[[error:local-login-disabled]]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user