Esempio n. 1
0
 /**
  * @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);
 }
Esempio n. 2
0
 /**
  * Returns a string representation of the filter.
  *
  * @return string
  */
 public function toString()
 {
     return '(!' . $this->_filter->toString() . ')';
 }