getCompleteName() 공개 메소드

Returns the user's full name from LDAP
public getCompleteName ( string $username ) : string
$username string Username
리턴 string
예제 #1
0
 /**
  * Adds a new user account to the authentication table.
  * Returns true on success, otherwise false.
  *
  * @param  string $login Login name
  * @param  string $pass  Password
  *
  * @return boolean
  */
 public function add($login, $pass)
 {
     $user = new PMF_User($this->_config);
     $result = $user->createUser($login, null);
     $this->ldap->connect($this->ldapServer[$this->activeServer]['ldap_server'], $this->ldapServer[$this->activeServer]['ldap_port'], $this->ldapServer[$this->activeServer]['ldap_base'], $this->ldapServer[$this->activeServer]['ldap_user'], $this->ldapServer[$this->activeServer]['ldap_password']);
     if ($this->ldap->error) {
         $this->errors[] = $this->ldap->error;
     }
     $user->setStatus('active');
     // Update user information from LDAP
     $user->setUserData(array('display_name' => $this->ldap->getCompleteName($login), 'email' => $this->ldap->getMail($login)));
     return $result;
 }
 /**
  * Does nothing. A function required to be a valid auth.
  *
  * @param string $login        Loginname
  * @param array  $optionalData Optional data
  * 
  * @return string
  */
 public function checkLogin($login, array $optionalData = null)
 {
     return $this->ldap->getCompleteName($login);
 }