本文整理匯總了PHP中Zend_Ldap_Filter_Abstract類的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap_Filter_Abstract類的具體用法?PHP Zend_Ldap_Filter_Abstract怎麽用?PHP Zend_Ldap_Filter_Abstract使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Zend_Ldap_Filter_Abstract類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getAccountFilter
/**
* @return string The LDAP search filter for matching directory accounts
*/
protected function _getAccountFilter($acctname)
{
/**
* @see Zend_Ldap_Filter_Abstract
*/
#require_once 'Zend/Ldap/Filter/Abstract.php';
$this->_splitName($acctname, $dname, $aname);
$accountFilterFormat = $this->_getAccountFilterFormat();
$aname = Zend_Ldap_Filter_Abstract::escapeValue($aname);
if ($accountFilterFormat) {
return sprintf($accountFilterFormat, $aname);
}
if (!$this->_getBindRequiresDn()) {
// is there a better way to detect this?
return sprintf("(&(objectClass=user)(sAMAccountName=%s))", $aname);
}
return sprintf("(&(objectClass=posixAccount)(uid=%s))", $aname);
}
示例2: toString
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return '(!' . $this->_filter->toString() . ')';
}