From 0971625e635336824c246941fac78b720168beae Mon Sep 17 00:00:00 2001 From: Andrew Rodrigues Date: Wed, 18 Apr 2018 17:59:38 -0400 Subject: [PATCH] allow global mods to still login locally as well as admins if disabled in ACP --- src/controllers/authentication.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 88d0ec5b49..3ad05c2626 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -380,8 +380,8 @@ authenticationController.localLogin = function (req, username, password, next) { userData: function (next) { db.getObjectFields('user:' + uid, ['password', 'passwordExpiry'], next); }, - isAdmin: function (next) { - user.isAdministrator(uid, next); + isAdminOrGlobalMod: function (next) { + user.isAdminOrGlobalMod(uid, next); }, banned: function (next) { user.isBanned(uid, next); @@ -391,9 +391,9 @@ authenticationController.localLogin = function (req, username, password, next) { function (result, next) { userData = result.userData; 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]]')); }