本文整理匯總了PHP中Zend_Ldap::getEntry方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap::getEntry方法的具體用法?PHP Zend_Ldap::getEntry怎麽用?PHP Zend_Ldap::getEntry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Ldap
的用法示例。
在下文中一共展示了Zend_Ldap::getEntry方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: create
/**
* Factory method to create the RootDSE.
*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_RootDse
* @throws Zend_Ldap_Exception
*/
public static function create(Zend_Ldap $ldap)
{
$dn = Zend_Ldap_Dn::fromString('');
$data = $ldap->getEntry($dn, array('*', '+'), true);
if (isset($data['domainfunctionality'])) {
/**
* @see Zend_Ldap_Node_RootDse_ActiveDirectory
*/
require_once 'Zend/Ldap/Node/RootDse/ActiveDirectory.php';
return new Zend_Ldap_Node_RootDse_ActiveDirectory($dn, $data);
} else {
if (isset($data['dsaname'])) {
/**
* @see Zend_Ldap_Node_RootDse_ActiveDirectory
*/
require_once 'Zend/Ldap/Node/RootDse/eDirectory.php';
return new Zend_Ldap_Node_RootDse_eDirectory($dn, $data);
} else {
if (isset($data['structuralobjectclass']) && $data['structuralobjectclass'][0] === 'OpenLDAProotDSE') {
/**
* @see Zend_Ldap_Node_RootDse_OpenLdap
*/
require_once 'Zend/Ldap/Node/RootDse/OpenLdap.php';
return new Zend_Ldap_Node_RootDse_OpenLdap($dn, $data);
} else {
return new self($dn, $data);
}
}
}
}
示例2: create
/**
* Factory method to create the Schema node.
*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema
* @throws Zend_Ldap_Exception
*/
public static function create(Zend_Ldap $ldap)
{
$dn = $ldap->getRootDse()->getSchemaDn();
$data = $ldap->getEntry($dn, array('*', '+'), true);
switch ($ldap->getRootDse()->getServerType()) {
case Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY:
/**
* @see Zend_Ldap_Node_Schema_ActiveDirectory
*/
return new Zend_Ldap_Node_Schema_ActiveDirectory($dn, $data, $ldap);
case Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP:
/**
* @see Zend_Ldap_Node_RootDse_ActiveDirectory
*/
return new Zend_Ldap_Node_Schema_OpenLdap($dn, $data, $ldap);
case Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY:
default:
return new self($dn, $data, $ldap);
}
}
示例3: fromLdap
/**
* Factory method to create an attached Zend_Ldap_Node for a given DN.
*
* @param string|array|Zend_Ldap_Dn $dn
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node|null
* @throws Zend_Ldap_Exception
*/
public static function fromLdap($dn, Zend_Ldap $ldap)
{
if (is_string($dn) || is_array($dn)) {
$dn = Zend_Ldap_Dn::factory($dn);
} else {
if ($dn instanceof Zend_Ldap_Dn) {
$dn = clone $dn;
} else {
/**
* @see Zend_Ldap_Exception
*/
require_once PHP_LIBRARY_PATH . 'Zend/Ldap/Exception.php';
throw new Zend_Ldap_Exception(null, '$dn is of a wrong data type.');
}
}
$data = $ldap->getEntry($dn, array('*', '+'), true);
if ($data === null) {
return null;
}
$entry = new self($dn, $data, true, $ldap);
return $entry;
}
示例4: _loadUser
/**
* This function takes care of loading the user from LDAP
* @param String $userId
* @return false if the data is not present, or an array containing the data.
*/
protected function _loadUser($userId)
{
$user = $this->_ldap->getEntry($this->_getDNForUserId($userId));
return $user;
}