#9019 Fixed id_user in active directory

This commit is contained in:
Daniel Maya 2022-05-25 13:00:04 +02:00
parent 79774dfb33
commit a78eb71995
1 changed files with 8 additions and 1 deletions

View File

@ -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;
}