Ldap/Dn.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Ldap
- Version
- $Id$
Package: Zend_LdapZend_Ldap_Dn provides an API for DN manipulation
- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties



string $_defaultCaseFold = self::ATTR_CASEFOLD_NONEstaticThe default case fold to use
Default valueself::ATTR_CASEFOLD_NONEDetails- Type
- string
Methods



_assertIndex(mixed $index) : booleanAssert index is correct and usable
Parameters| Name | Type | Description |
|---|
| $index | mixed | |
|---|
ReturnsThrows 


_assertRdn(array $value) : booleanstaticAssert if value is in a correct RDN format
Parameters| Name | Type | Description |
|---|
| $value | array | |
|---|
ReturnsThrows 


_caseFoldDn(array $dn, string $caseFold) : arraystaticDo a case folding on a DN ort part of it
Parameters| Name | Type | Description |
|---|
| $dn | array | |
|---|
| $caseFold | string | |
|---|
Returns 


_caseFoldRdn(array $part, string $caseFold) : arraystaticDo a case folding on a RDN
Parameters| Name | Type | Description |
|---|
| $part | array | |
|---|
| $caseFold | string | |
|---|
Returns 


_sanitizeCaseFold(string $caseFold, $default) : stringstaticSanitizes the case fold
Parameters| Name | Type | Description |
|---|
| $caseFold | string | |
|---|
| $default | | |
|---|
Returns 


checkDn(string $dn, array $keys = null, array $vals = null, string $caseFold = self::ATTR_CASEFOLD_NONE) : booleanParameters| Name | Type | Description |
|---|
| $dn | string | The DN to parse |
|---|
| $keys | array | An optional array to receive DN keys (e.g. CN, OU, DC, ...) |
|---|
| $vals | array | An optional array to receive DN values |
|---|
| $caseFold | string | |
|---|
Returns| Type | Description |
|---|
| boolean | True if the DN was successfully parsed or false if the string is not a valid DN. |



escapeValue(string | array $values = array()) : arraystaticEscapes 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.
Parameters| Name | Type | Description |
|---|
| $values | string | array | An array containing the DN values that should be escaped |
|---|
Returns| Type | Description |
|---|
| array | The array $values, but escaped |
Details- Author
- Benedikt Hallinger
- Link
- http://pear.php.net/package/Net_LDAP2
- See
- from Benedikt Hallinger



explodeDn(string $dn, array $keys = null, array $vals = null, string $caseFold = self::ATTR_CASEFOLD_NONE) : arraystaticCreates 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.
Parameters| Name | Type | Description |
|---|
| $dn | string | |
|---|
| $keys | array | An optional array to receive DN keys (e.g. CN, OU, DC, ...) |
|---|
| $vals | array | An optional array to receive DN values |
|---|
| $caseFold | string | |
|---|
ReturnsThrows


factory(string | array $dn, string | null $caseFold = null) : \Zend_Ldap_DnstaticCreates a DN from an array or a string
Parameters| Name | Type | Description |
|---|
| $dn | string | array | |
|---|
| $caseFold | string | null | |
|---|
ReturnsThrows 


fromArray(array $dn, string | null $caseFold = null) : \Zend_Ldap_DnstaticCreates a DN from an array
Parameters| Name | Type | Description |
|---|
| $dn | array | |
|---|
| $caseFold | string | null | |
|---|
ReturnsThrows 


fromString(string $dn, string | null $caseFold = null) : \Zend_Ldap_DnstaticCreates a DN from a string
Parameters| Name | Type | Description |
|---|
| $dn | string | |
|---|
| $caseFold | string | null | |
|---|
ReturnsThrows 


getParentDn(int $levelUp = 1) : \Zend_Ldap_DnGet the parent DN $levelUp levels up the tree
Parameters| Name | Type | Description |
|---|
| $levelUp | int | |
|---|
Returns 


getRdn(string $caseFold = null) : arrayGets the RDN of the current DN
Parameters| Name | Type | Description |
|---|
| $caseFold | string | |
|---|
ReturnsThrows 


getRdnString(string $caseFold = null) : stringGets the RDN of the current DN as a string
Parameters| Name | Type | Description |
|---|
| $caseFold | string | |
|---|
ReturnsThrows 


implodeDn(array $dnArray, string $caseFold = null, string $separator = ',') : stringstaticImplodes an array in the form delivered by {@link 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")
)
Parameters| Name | Type | Description |
|---|
| $dnArray | array | |
|---|
| $caseFold | string | |
|---|
| $separator | string | |
|---|
ReturnsThrows


implodeRdn( $part, string $caseFold = null) : stringstaticReturns 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.
Parameters| Name | Type | Description |
|---|
| $part | | |
|---|
| $caseFold | string | |
|---|
ReturnsThrows


offsetExists(int $offset) : booleanRequired by the ArrayAccess implementation
Parameters| Name | Type | Description |
|---|
| $offset | int | |
|---|
Returns 


offsetGet(int $offset) : arrayProxy to {@see get()}
Required by the ArrayAccess implementation
Parameters| Name | Type | Description |
|---|
| $offset | int | |
|---|
Returns 


offsetSet(int $offset, array $value) : voidProxy to {@see set()}
Required by the ArrayAccess implementation
Parameters| Name | Type | Description |
|---|
| $offset | int | |
|---|
| $value | array | |
|---|



offsetUnset(int $offset) : voidProxy to {@see remove()}
Required by the ArrayAccess implementation
Parameters| Name | Type | Description |
|---|
| $offset | int | |
|---|



setDefaultCaseFold(string $caseFold) : voidstaticSets the default case fold
Parameters| Name | Type | Description |
|---|
| $caseFold | string | |
|---|