Horde_Ldap_Util::splitAttributeString PHP Method

splitAttributeString() public static method

The split will occur at the first unescaped '=' character.
public static splitAttributeString ( string $attr ) : array
$attr string An attribute-value string.
return array Indexed array: 0=attribute name, 1=attribute value.
    public static function splitAttributeString($attr)
    {
        return preg_split('/(?<!\\\\)=/', $attr, 2);
    }

Usage Example

コード例 #1
0
ファイル: Ldap.php プロジェクト: DSNS-LAB/Dmail
 /**
  * Returns the win32 AD epoch number of days the password may be unchanged.
  *
  * @return integer|boolean  Number of days or false if no limit.
  */
 protected function _getMaxPasswd()
 {
     $dn = Horde_Ldap_Util::explodeDN($this->_params['basedn']);
     $domaindn = array();
     foreach ($dn as $rdn) {
         $attribute = Horde_Ldap_Util::splitAttributeString($rdn);
         if ($attribute[0] == 'DC') {
             $domaindn[] = $rdn;
         }
     }
     $dn = Horde_Ldap_Util::canonicalDN($domaindn);
     $search = $this->_ldap->search($domaindn, 'objectClass=*');
     $entry = $search->shiftEntry();
     try {
         return $entry->getValue('maxPwdAge', 'single');
     } catch (Horde_Ldap_Exception $e) {
         return false;
     }
 }
All Usage Examples Of Horde_Ldap_Util::splitAttributeString