/** * 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); }
public function testPasswordSettingCustomAttribute() { $data = array(); Attribute::setPassword($data, 'pa$$w0rd', Attribute::PASSWORD_HASH_SHA, 'myAttribute'); $password = Attribute::getAttribute($data, 'myAttribute', 0); $this->assertNotNull($password); }