/**
  * {@inheritdoc}
  */
 public function getUserInfo($username)
 {
     if (null === $this->ldapRes) {
         $this->connect();
     }
     $user = new User();
     $user->setUsername(self::USER_NAME);
     $user->setEmail(self::USER_EMAIL);
     return $user;
 }
 /**
  * {@inheritdoc}
  */
 public function getUserInfo($username)
 {
     if (null === $this->ldapRes) {
         $this->connect();
     }
     $result = @ldap_search($this->ldapRes, $this->baseDn, sprintf('uid=%s', $username));
     $entries = @ldap_get_entries($this->ldapRes, $result);
     if ($entries['count'] == 0) {
         return null;
     }
     $user = new User();
     $user->setDn($entries[0]['dn']);
     $user->setEmail($entries[0]['mail'][0]);
     $user->setUsername($username);
     return $user;
 }