From 4196658956343e6b73bf686f3f8a322b3aa45580 Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Thu, 24 Oct 2019 17:33:09 +0200 Subject: [PATCH] FEAT #12070 TIME 0:15 Basic authentication is only possible when connection is standard --- src/core/controllers/AuthenticationController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/controllers/AuthenticationController.php b/src/core/controllers/AuthenticationController.php index d0591b4dfc7..d5959923e3b 100755 --- a/src/core/controllers/AuthenticationController.php +++ b/src/core/controllers/AuthenticationController.php @@ -27,7 +27,15 @@ class AuthenticationController $userId = null; if (!empty($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_PW'])) { if (AuthenticationModel::authentication(['userId' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']])) { - $userId = $_SERVER['PHP_AUTH_USER']; + $loginMethod = CoreConfigModel::getLoggingMethod(); + if ($loginMethod['id'] != 'standard') { + $user = UserModel::getByLogin(['select' => ['loginmode'], 'userId' => $_SERVER['PHP_AUTH_USER']]); + if ($user['loginmode'] == 'restMode') { + $userId = $_SERVER['PHP_AUTH_USER']; + } + } else { + $userId = $_SERVER['PHP_AUTH_USER']; + } } } else { $cookie = AuthenticationModel::getCookieAuth(); -- GitLab