From fb9100efdcff8bc85eda76053bf64ce1a64f88ac Mon Sep 17 00:00:00 2001 From: yuri Date: Thu, 23 Aug 2018 12:41:03 +0300 Subject: [PATCH] maintenanceMode param --- application/Espo/Core/Utils/Auth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/Espo/Core/Utils/Auth.php b/application/Espo/Core/Utils/Auth.php index 4b13f0ae63..0b8ed56487 100644 --- a/application/Espo/Core/Utils/Auth.php +++ b/application/Espo/Core/Utils/Auth.php @@ -180,6 +180,10 @@ class Auth return; } + if (!$user->isAdmin() && $this->getConfig()->get('maintenanceMode')) { + throw new \Espo\Core\Exceptions\ServiceUnavailable("Application is in maintenance mode."); + } + if (!$user->isActive()) { $GLOBALS['log']->info("AUTH: Trying to login as user '".$user->get('userName')."' which is not active."); $this->logDenied($authLogRecord, 'INACTIVE_USER');