Skip to content

Commit

Permalink
Merge pull request #12 from JacksWastedLife/patch-1
Browse files Browse the repository at this point in the history
Implemented retrieveById() this will fix #11
  • Loading branch information
Sascha Dens committed Feb 26, 2015
2 parents 2f6046d + 931b0dc commit 6261b30
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Dsdevbe/LdapConnector/LdapUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ public function __construct($config)
*/
public function retrieveById($identifier)
{
// TODO: Implement retrieveById() method.
$userInfo = $this->adldap->user()->info($identifier, array('*'))[0];

$credentials = array();
$credentials['username'] = $identifier;

foreach($userInfo as $key => $value){
$credentials[$key] = $value[0];
}

return new LdapUser($credentials);
}

/**
Expand Down Expand Up @@ -83,4 +92,4 @@ public function validateCredentials(Authenticatable $user, array $credentials)
return $this->adldap->authenticate($username, $password);
}

}
}

0 comments on commit 6261b30

Please sign in to comment.