static boolean
checkDn
(string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
-
string
$dn: The DN to parse
-
array
$keys: An optional array to receive DN keys (e.g. CN, OU, DC, ...)
-
array
$vals: An optional array to receive DN values
-
string
$caseFold
-
array
&$keys
-
array
&$vals
Escapes a DN value according to RFC 2253
Escapes the given VALUES according to RFC 2253 so that they can be safely used in LDAP DNs. The characters ",", "+", """, "\", "<", ">", ";", "#", " = " with a special meaning in RFC 2252 are preceeded by ba backslash. Control characters with an ASCII code < 32 are represented as \hexpair. Finally all leading and trailing spaces are converted to sequences of \20.
static array
escapeValue
([string|array $values = array()])
-
string|array
$values: An array containing the DN values that should be escaped
Creates an array containing all parts of the given DN.
Array will be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") ) for a DN of cn=name1+uid=user,cn=name2,dc=example,dc=org.
static array
explodeDn
(string $dn, [ &$keys = null], [ &$vals = null], [string $caseFold = self::ATTR_CASEFOLD_NONE], array $keys, array $vals)
-
string
$dn
-
array
$keys: An optional array to receive DN keys (e.g. CN, OU, DC, ...)
-
array
$vals: An optional array to receive DN values
-
string
$caseFold
-
array
&$keys
-
array
&$vals
Creates a DN from an array or a string
static
Zend_Ldap_Dn
factory
(
string|array $dn, [
string|null $caseFold =
null])
-
string|array
$dn
-
string|null
$caseFold
Creates a DN from an array
static
Zend_Ldap_Dn
fromArray
(
$dn, [
string|null $caseFold =
null])
-
array
$dn
-
string|null
$caseFold
Creates a DN from a string
static
Zend_Ldap_Dn
fromString
(
string $dn, [
string|null $caseFold =
null])
-
string
$dn
-
string|null
$caseFold
Implodes an array in the form delivered by explodeDn() to a DN string.
$dnArray must be of type array( array("cn" => "name1", "uid" => "user"), array("cn" => "name2"), array("dc" => "example"), array("dc" => "org") )
static string
implodeDn
( $dnArray, [string $caseFold = null], [string $separator = ','])
-
array
$dnArray
-
string
$caseFold
-
string
$separator
Returns a DN part in the form $attribute = $value
This method supports the creation of multi-valued RDNs $part must contain an even number of elemets.
static string
implodeRdn
( $part, [string $caseFold = null], array $attribute)
-
array
$attribute
-
string
$caseFold
-
array
$part
Checks if given $childDn is beneath $parentDn subtree.
Sets the default case fold
static void
setDefaultCaseFold
(string $caseFold)
Undoes the conversion done by escapeValue().
Any escape sequence starting with a baskslash - hexpair or special character - will be transformed back to the corresponding character.
static array
unescapeValue
([string|array $values = array()])
-
string|array
$values: Array of DN Values
Assert if value is in a correct RDN format
static boolean
_assertRdn
( $value)
Do a case folding on a DN ort part of it
static array
_caseFoldDn
( $dn, string $caseFold)
-
array
$dn
-
string
$caseFold
Do a case folding on a RDN
static array
_caseFoldRdn
( $part, string $caseFold)
-
array
$part
-
string
$caseFold
Sanitizes the case fold
static string
_sanitizeCaseFold
(string $caseFold, $default)
-
string
$caseFold
-
$default
Constructor
Zend_Ldap_Dn
__construct
( $dn, string|null $caseFold)
-
array
$dn
-
string|null
$caseFold
Get a DN part
array
get
(int $index, [int $length = 1], [string $caseFold = null])
-
int
$index
-
int
$length
-
string
$caseFold
Get the parent DN $levelUp levels up the tree
Gets the RDN of the current DN
array
getRdn
([string $caseFold = null])
Gets the RDN of the current DN as a string
string
getRdnString
([string $caseFold = null])
Required by the ArrayAccess implementation
boolean
offsetExists
(int $offset)
Implementation of:
- ArrayAccess::offsetExists
Proxy to {@see get()} Required by the ArrayAccess implementation
array
offsetGet
(int $offset)
Implementation of:
- ArrayAccess::offsetGet
Proxy to {@see set()} Required by the ArrayAccess implementation
void
offsetSet
(int $offset, array $value)
Implementation of:
- ArrayAccess::offsetSet
Proxy to {@see remove()} Required by the ArrayAccess implementation
void
offsetUnset
(int $offset)
Implementation of:
- ArrayAccess::offsetUnset
Sets the case fold
void
setCaseFold
(string|null $caseFold)
Return DN as an array
array
toArray
([string $caseFold = null])
Return DN as a string
string
toString
([string $caseFold = null])
Assert index is correct and usable
boolean
_assertIndex
(mixed $index)
Cast to string representation {@see toString()}
string
__toString
()