From c6d88ac4570179de06374d5cf3c8b1680e62ecd9 Mon Sep 17 00:00:00 2001 From: Omar Nava Date: Thu, 19 Feb 2015 11:50:01 -0600 Subject: [PATCH] Retrieving user information Pull request #4 Now it's easy to retrieve user info Auth::user()->displayname; You can try var_dump(Auth::user()); for knowing all info available --- src/Dsdevbe/LdapConnector/LdapUserProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Dsdevbe/LdapConnector/LdapUserProvider.php b/src/Dsdevbe/LdapConnector/LdapUserProvider.php index a0b0254..1a4f46d 100755 --- a/src/Dsdevbe/LdapConnector/LdapUserProvider.php +++ b/src/Dsdevbe/LdapConnector/LdapUserProvider.php @@ -79,8 +79,12 @@ public function updateRememberToken(Authenticatable $user, $token) */ public function retrieveByCredentials(array $credentials) { - if($this->adldap->user()->info($credentials['username'])) + if($userInfo = $this->adldap->user()->info($credentials['username'])) { + $userInfo = $userInfo[0]; + foreach($userInfo as $u=>$a){ + $credentials[$u]=$a[0]; + } return new LdapUser($credentials); } }