From: umorigu Date: Sun, 7 Feb 2016 16:51:18 +0000 (+0900) Subject: BugTrack2/374 Get fullname from LDAP server on AUTH_TYPE_EXTERNAL X-Git-Tag: r1_5_1~19 X-Git-Url: http://git.osdn.net/view?p=pukiwiki%2Fpukiwiki.git;a=commitdiff_plain;h=0de00ddd7cbbed03e9b274c712c7e02bcfefde65 BugTrack2/374 Get fullname from LDAP server on AUTH_TYPE_EXTERNAL --- diff --git a/lib/auth.php b/lib/auth.php index e53a2bd..14e075e 100644 --- a/lib/auth.php +++ b/lib/auth.php @@ -244,7 +244,7 @@ function ensure_valid_auth_user() { global $auth_type, $auth_users, $_msg_auth, $auth_user, $auth_groups; global $auth_user_groups, $auth_user_fullname; - global $auth_provider_user_prefix; + global $auth_provider_user_prefix, $ldap_user_account; switch ($auth_type) { case AUTH_TYPE_BASIC: { @@ -278,13 +278,14 @@ function ensure_valid_auth_user() if (isset($_SESSION['authenticated_user_fullname'])) { $fullname = $_SESSION['authenticated_user_fullname']; } else { + $fullname = $user; if ($auth_type === AUTH_TYPE_EXTERNAL && $ldap_user_account) { $ldap_user_info = ldap_get_simple_user_info($user); if ($ldap_user_info) { $fullname = $ldap_user_info['fullname']; - $_SESSION['authenticated_user_fullname'] = $fullname; } } + $_SESSION['authenticated_user_fullname'] = $fullname; } } $auth_user = $user;