예제 #1
0
 /**
  * Gets a LDAP attribute.
  *
  * This is an offline method.
  *
  * @param  string  $name
  * @param  int $index
  * @return mixed
  * @throws \Zend\Ldap\Exception\LdapException
  */
 public function getAttribute($name, $index = null)
 {
     if ($name == 'dn') {
         return $this->getDnString();
     }
     return Ldap\Attribute::getAttribute($this->currentData, $name, $index);
 }
예제 #2
0
 public function testPasswordSettingCustomAttribute()
 {
     $data = array();
     Attribute::setPassword($data, 'pa$$w0rd', Attribute::PASSWORD_HASH_SHA, 'myAttribute');
     $password = Attribute::getAttribute($data, 'myAttribute', 0);
     $this->assertNotNull($password);
 }