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');