本文整理汇总了PHP中Zend_Ldap_Dn::isChildOf方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Ldap_Dn::isChildOf方法的具体用法?PHP Zend_Ldap_Dn::isChildOf怎么用?PHP Zend_Ldap_Dn::isChildOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Ldap_Dn
的用法示例。
在下文中一共展示了Zend_Ldap_Dn::isChildOf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: attachLdap
/**
* Attach node to an LDAP connection
*
* This is an offline method.
*
* @uses Zend_Ldap_Dn::isChildOf()
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node Provides a fluid interface
* @throws Zend_Ldap_Exception
*/
public function attachLdap(Zend_Ldap $ldap)
{
if (!Zend_Ldap_Dn::isChildOf($this->_getDn(), $ldap->getBaseDn())) {
/**
* @see Zend_Ldap_Exception
*/
require_once PHP_LIBRARY_PATH . 'Zend/Ldap/Exception.php';
throw new Zend_Ldap_Exception(null, 'LDAP connection is not responsible for given node.', Zend_Ldap_Exception::LDAP_OTHER);
}
if ($ldap !== $this->_ldap) {
$this->_ldap = $ldap;
if (is_array($this->_children)) {
foreach ($this->_children as $child) {
$child->attachLdap($ldap);
}
}
}
return $this;
}
示例2: attachLdap
/**
* Attach node to an LDAP connection
*
* This is an offline method.
*
* @uses Zend_Ldap_Dn::isChildOf()
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node Provides a fluent interface
* @throws Zend_Ldap_Exception
*/
public function attachLdap(Zend_Ldap $ldap)
{
if (!Zend_Ldap_Dn::isChildOf($this->_getDn(), $ldap->getBaseDn())) {
/**
* @see Zend_Ldap_Exception
*/
throw new Zend_Ldap_Exception(null, 'LDAP connection is not responsible for given node.', Zend_Ldap_Exception::LDAP_OTHER);
}
if ($ldap !== $this->_ldap) {
$this->_ldap = $ldap;
if (is_array($this->_children)) {
foreach ($this->_children as $child) {
/* @var Zend_Ldap_Node $child */
$child->attachLdap($ldap);
}
}
}
return $this;
}
示例3: testIsChildOfParentDnLonger
public function testIsChildOfParentDnLonger()
{
$dn1 = 'dc=example,dc=de';
$dn2 = 'cb=name1,cn=name2,dc=example,dc=org';
$this->assertFalse(Zend_Ldap_Dn::isChildOf($dn1, $dn2));
}
示例4: _getSpecialResultDataFromLdap
/**
* (non-PHPdoc)
*/
protected function _getSpecialResultDataFromLdap()
{
$filter = "&";
foreach ($this->_simpleMailConfig['skeleton'] as $attr => $val) {
if (is_array($val)) {
foreach ($val as $val_array) {
$filter .= '(' . $attr . '=' . $val_array . ')';
}
} else {
$filter .= '(' . $attr . '=' . $val . ')';
}
}
$ldap = $this->_ldap->searchEntries(Zend_Ldap_Filter::string($filter), $this->_simpleMailConfig['base'], $this->_simpleMailConfig['scope'], array());
/* Make sure, the managed rdn is last in array and properties are
* ultimately read from this rdn (if entries are doubled)
*
* Order of array matters:
* - all entries anywhere
* - entries within the storage path
* - the exact managed dn
*/
$this->_ldapRawData = array();
$managedPath = Zend_Ldap_Dn::fromString($this->_simpleMailConfig['storage_base'], Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER);
$managedDn = Zend_Ldap_Dn::fromString($this->_simpleMailConfig['storage_rdn'] . ',' . $this->_simpleMailConfig['storage_base'], Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER);
$managedDnExisting = false;
foreach ($ldap as $dn) {
$dnArr = Zend_Ldap_Dn::fromString($dn['dn'], Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER);
if ($dnArr->toString() == $managedDn->toString()) {
array_push($this->_ldapRawData, $dn);
$managedDnExisting = true;
} elseif (Zend_Ldap_Dn::isChildOf($dnArr, $managedPath)) {
$managedDnExisting === true ? array_splice($this->_ldapRawData, -1, 0, array($dn)) : array_push($this->_ldapRawData, $dn);
} else {
$dn['simplemail_readonly'] = true;
array_unshift($this->_ldapRawData, $dn);
}
}
if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' simpleMail - Tinebase_EmailUser combined with ldap: ' . print_r($this->_ldapRawData, true));
}
}