From a78eb719958e80d1a5c6e073fc2a80f7f7365665 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 25 May 2022 13:00:04 +0200 Subject: [PATCH] #9019 Fixed id_user in active directory --- pandora_console/include/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index ca0c9dad7d..64fa0bce93 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2262,7 +2262,14 @@ function check_login($output=true) || (isset($_SESSION['merge-request-user-trick']) === true && $_SESSION['merge-request-user-trick'] === $_SESSION['id_usuario']) ) { - $config['id_user'] = $_SESSION['id_usuario']; + if (isset($config['auth']) === true && $config['auth'] === 'ad' && is_user($_SESSION['id_usuario'])) { + // User name in active directory is case insensitive. + // Get the user name from database. + $user_info = get_user_info($_SESSION['id_usuario']); + $config['id_user'] = $user_info['id_user']; + } else { + $config['id_user'] = $_SESSION['id_usuario']; + } return true; }