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_NONE
staticThe default case fold to use
Default valueself::ATTR_CASEFOLD_NONE
Details- Type
- string
Methods



_assertIndex(mixed $index) : boolean
Assert index is correct and usable
ParametersName | Type | Description |
---|
$index | mixed | |
---|
ReturnsThrows 


_assertRdn(array $value) : boolean
staticAssert if value is in a correct RDN format
ParametersName | Type | Description |
---|
$value | array | |
---|
ReturnsThrows 


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


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


_sanitizeCaseFold(string $caseFold, $default) : string
staticSanitizes the case fold
ParametersName | Type | Description |
---|
$caseFold | string | |
---|
$default | | |
---|
Returns 


checkDn(string $dn, array $keys = null, array $vals = null, string $caseFold = self::ATTR_CASEFOLD_NONE) : boolean
ParametersName | 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 | |
---|
ReturnsType | Description |
---|
boolean | True if the DN was successfully parsed or false if the string is not a valid DN. |



escapeValue(string | array $values = array()) : array
staticEscapes 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.
ParametersName | Type | Description |
---|
$values | string | array | An array containing the DN values that should be escaped |
---|
ReturnsType | 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) : array
staticCreates 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.
ParametersName | 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_Dn
staticCreates a DN from an array or a string
ParametersName | Type | Description |
---|
$dn | string | array | |
---|
$caseFold | string | null | |
---|
ReturnsThrows 


fromArray(array $dn, string | null $caseFold = null) : \Zend_Ldap_Dn
staticCreates a DN from an array
ParametersName | Type | Description |
---|
$dn | array | |
---|
$caseFold | string | null | |
---|
ReturnsThrows 


fromString(string $dn, string | null $caseFold = null) : \Zend_Ldap_Dn
staticCreates a DN from a string
ParametersName | Type | Description |
---|
$dn | string | |
---|
$caseFold | string | null | |
---|
ReturnsThrows 


getParentDn(int $levelUp = 1) : \Zend_Ldap_Dn
Get the parent DN $levelUp levels up the tree
ParametersName | Type | Description |
---|
$levelUp | int | |
---|
Returns 


getRdn(string $caseFold = null) : array
Gets the RDN of the current DN
ParametersName | Type | Description |
---|
$caseFold | string | |
---|
ReturnsThrows 


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


implodeDn(array $dnArray, string $caseFold = null, string $separator = ',') : string
staticImplodes 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")
)
ParametersName | Type | Description |
---|
$dnArray | array | |
---|
$caseFold | string | |
---|
$separator | string | |
---|
ReturnsThrows


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


offsetExists(int $offset) : boolean
Required by the ArrayAccess implementation
ParametersName | Type | Description |
---|
$offset | int | |
---|
Returns 


offsetGet(int $offset) : array
Proxy to {@see get()}
Required by the ArrayAccess implementation
ParametersName | Type | Description |
---|
$offset | int | |
---|
Returns 


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



offsetUnset(int $offset) : void
Proxy to {@see remove()}
Required by the ArrayAccess implementation
ParametersName | Type | Description |
---|
$offset | int | |
---|



setDefaultCaseFold(string $caseFold) : void
staticSets the default case fold
ParametersName | Type | Description |
---|
$caseFold | string | |
---|