本文整理汇总了PHP中Zend\Ldap\Ldap::getEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP Ldap::getEntry方法的具体用法?PHP Ldap::getEntry怎么用?PHP Ldap::getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Ldap\Ldap
的用法示例。
在下文中一共展示了Ldap::getEntry方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reload
/**
* Reload node attributes from LDAP.
*
* This is an online method.
*
* @param \Zend\Ldap\Ldap $ldap
* @return AbstractNode Provides a fluid interface
*/
public function reload(Ldap\Ldap $ldap = null)
{
if ($ldap !== null) {
$data = $ldap->getEntry($this->_getDn(), array('*', '+'), true);
$this->loadData($data, true);
}
return $this;
}
示例2: create
/**
* Factory method to create the RootDse.
*
* @param \Zend\Ldap\Ldap $ldap
* @return RootDse
*/
public static function create(Ldap\Ldap $ldap)
{
$dn = Ldap\Dn::fromString('');
$data = $ldap->getEntry($dn, ['*', '+'], true);
if (isset($data['domainfunctionality'])) {
return new RootDse\ActiveDirectory($dn, $data);
} elseif (isset($data['dsaname'])) {
return new RootDse\eDirectory($dn, $data);
} elseif (isset($data['structuralobjectclass']) && $data['structuralobjectclass'][0] === 'OpenLDAProotDSE') {
return new RootDse\OpenLdap($dn, $data);
}
return new static($dn, $data);
}
示例3: create
/**
* Factory method to create the Schema node.
*
* @param \Zend\Ldap\Ldap $ldap
* @return \Zend\Ldap\Node\Schema
* @throws \Zend\Ldap\Exception
*/
public static function create(Ldap\Ldap $ldap)
{
$dn = $ldap->getRootDse()->getSchemaDn();
$data = $ldap->getEntry($dn, array('*', '+'), true);
switch ($ldap->getRootDse()->getServerType()) {
case RootDSE::SERVER_TYPE_ACTIVEDIRECTORY:
return new Schema\ActiveDirectory($dn, $data, $ldap);
case RootDSE::SERVER_TYPE_OPENLDAP:
return new Schema\OpenLdap($dn, $data, $ldap);
case RootDSE::SERVER_TYPE_EDIRECTORY:
default:
return new self($dn, $data, $ldap);
}
}
示例4: findByUsername
public function findByUsername($username)
{
$this->bind();
$entryDN = "uid={$username}," . $this->active_server['baseDn'];
$this->log("Attempting to get username entry: {$entryDN} against the active ldap server");
try {
$hm = $this->ldap->getEntry($entryDN);
$this->log("Raw Ldap Object: " . var_export($hm, true), 7);
$this->log("Username entry lookup response: " . var_export($hm, true));
return $hm;
} catch (LdapException $exc) {
return $exc->getMessage();
}
}
示例5: fromLdap
/**
* Factory method to create an attached Zend\Ldap\Node for a given DN.
*
* @param string|array|Dn $dn
* @param Ldap $ldap
* @return Node|null
* @throws Exception\LdapException
*/
public static function fromLdap($dn, Ldap $ldap)
{
if (is_string($dn) || is_array($dn)) {
$dn = Dn::factory($dn);
} elseif ($dn instanceof Dn) {
$dn = clone $dn;
} else {
throw new Exception\LdapException(null, '$dn is of a wrong data type.');
}
$data = $ldap->getEntry($dn, ['*', '+'], true);
if ($data === null) {
return;
}
$entry = new static($dn, $data, true, $ldap);
return $entry;
}