Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=array()) | |
Constructor. | |
__destruct () | |
Destructor. | |
getResource () | |
getLastErrorCode () | |
Return the LDAP error number of the last LDAP command. | |
getLastError (&$errorCode=null, array &$errorMessages=null) | |
Return the LDAP error message of the last LDAP command. | |
getBoundUser () | |
Get the currently bound user. | |
setOptions ($options) | |
Sets the options used in connecting, binding, etc. | |
getOptions () | |
getBaseDn () | |
Gets the base DN under which objects of interest are located. | |
getCanonicalAccountName ($acctname, $form=0) | |
disconnect () | |
connect ($host=null, $port=null, $useSsl=null, $useStartTls=null) | |
To connect using SSL it seems the client tries to verify the server certificate by default. | |
bind ($username=null, $password=null) | |
search ($filter, $basedn=null, $scope=self::SEARCH_SCOPE_SUB, array $attributes=array(), $sort=null, $collectionClass=null, $sizelimit=0, $timelimit=0) | |
A global LDAP search routine for finding information. | |
count ($filter, $basedn=null, $scope=self::SEARCH_SCOPE_SUB) | |
Count items found by given filter. | |
countChildren ($dn) | |
Count children for a given DN. | |
exists ($dn) | |
Check if a given DN exists. | |
searchEntries ($filter, $basedn=null, $scope=self::SEARCH_SCOPE_SUB, array $attributes=array(), $sort=null, $reverseSort=false, $sizelimit=0, $timelimit=0) | |
Search LDAP registry for entries matching filter and optional attributes. | |
getEntry ($dn, array $attributes=array(), $throwOnNotFound=false) | |
Get LDAP entry by DN. | |
add ($dn, array $entry) | |
Add new information to the LDAP repository. | |
update ($dn, array $entry) | |
Update LDAP registry. | |
save ($dn, array $entry) | |
Save entry to LDAP registry. | |
delete ($dn, $recursively=false) | |
Delete an LDAP entry. | |
moveToSubtree ($from, $to, $recursively=false, $alwaysEmulate=false) | |
Moves a LDAP entry from one DN to another subtree. | |
move ($from, $to, $recursively=false, $alwaysEmulate=false) | |
Moves a LDAP entry from one DN to another DN. | |
rename ($from, $to, $recursively=false, $alwaysEmulate=false) | |
Renames a LDAP entry from one DN to another DN. | |
copyToSubtree ($from, $to, $recursively=false) | |
Copies a LDAP entry from one DN to another subtree. | |
copy ($from, $to, $recursively=false) | |
Copies a LDAP entry from one DN to another DN. | |
getNode ($dn) | |
Returns the specified DN as a Zend_Ldap_Node. | |
getBaseNode () | |
Returns the base node as a Zend_Ldap_Node. | |
getRootDse () | |
Returns the RootDSE. | |
getSchema () | |
Returns the schema. | |
Static Public Member Functions | |
static | filterEscape ($str) |
static | explodeDn ($dn, array &$keys=null, array &$vals=null) |
static | prepareLdapEntryArray (array &$entry) |
Prepares an ldap data entry array for insert/update operation. | |
Public Attributes | |
const | SEARCH_SCOPE_SUB = 1 |
const | SEARCH_SCOPE_ONE = 2 |
const | SEARCH_SCOPE_BASE = 3 |
const | ACCTNAME_FORM_DN = 1 |
const | ACCTNAME_FORM_USERNAME = 2 |
const | ACCTNAME_FORM_BACKSLASH = 3 |
const | ACCTNAME_FORM_PRINCIPAL = 4 |
Protected Member Functions | |
_getHost () | |
_getPort () | |
_getUseSsl () | |
_getUsername () | |
_getPassword () | |
_getBindRequiresDn () | |
_getAccountCanonicalForm () | |
_getAccountDomainName () | |
_getAccountDomainNameShort () | |
_getAccountFilterFormat () | |
_getAllowEmptyPassword () | |
_getUseStartTls () | |
_getOptReferrals () | |
_getTryUsernameSplit () | |
_getAccountFilter ($acctname) | |
_splitName ($name, &$dname, &$aname) | |
_getAccountDn ($acctname) | |
_isPossibleAuthority ($dname) | |
_getAccount ($acctname, array $attrs=null) | |
_createCollection (Zend_Ldap_Collection_Iterator_Default $iterator, $collectionClass) | |
Extension point for collection creation. | |
_getChildrenDns ($parentDn) | |
Retrieve the immediate children DNs of the given $parentDn. | |
Protected Attributes | |
$_options = null | |
$_resource = null | |
$_boundUser = false | |
$_rootDse = null | |
$_schema = null | |
__construct | ( | $options = array() | ) |
Constructor.
array | Zend_Config | $options | Options used in connecting, binding, etc. |
Zend_Ldap_Exception | if ext/ldap is not installed |
__destruct | ( | ) |
Destructor.
|
protected |
Extension point for collection creation.
Zend_Ldap_Collection_Iterator_Default | $iterator | |
string | null | $collectionClass |
Zend_Ldap_Exception |
|
protected |
array | $attrs | An array of names of desired attributes |
Zend_Ldap_Exception |
|
protected |
|
protected |
string | $acctname | The name of the account |
Zend_Ldap_Exception |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Retrieve the immediate children DNs of the given $parentDn.
This method is used in recursive methods like {
string | Zend_Ldap_Dn | $parentDn |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
string | $dname | The domain name to check |
|
protected |
string | $name | The name to split |
string | $dname | The resulting domain name (this is an out parameter) |
string | $aname | The resulting account name (this is an out parameter) |
add | ( | $dn, | |
array | $entry | ||
) |
Add new information to the LDAP repository.
string | Zend_Ldap_Dn | $dn | |
array | $entry |
Zend_Ldap_Exception |
bind | ( | $username = null , |
|
$password = null |
|||
) |
string | $username | The username for authenticating the bind |
string | $password | The password for authenticating the bind |
Zend_Ldap_Exception |
connect | ( | $host = null , |
|
$port = null , |
|||
$useSsl = null , |
|||
$useStartTls = null |
|||
) |
To connect using SSL it seems the client tries to verify the server certificate by default.
One way to disable this behavior is to set 'TLS_REQCERT never' in OpenLDAP's ldap.conf and restarting Apache. Or, if you really care about the server's cert you can put a cert on the web server.
string | $host | The hostname of the LDAP server to connect to |
int | $port | The port number of the LDAP server to connect to |
boolean | $useSsl | Use SSL |
boolean | $useStartTls | Use STARTTLS |
Zend_Ldap_Exception |
copy | ( | $from, | |
$to, | |||
$recursively = false |
|||
) |
Copies a LDAP entry from one DN to another DN.
string | Zend_Ldap_Dn | $from | |
string | Zend_Ldap_Dn | $to | |
boolean | $recursively |
Zend_Ldap_Exception |
copyToSubtree | ( | $from, | |
$to, | |||
$recursively = false |
|||
) |
Copies a LDAP entry from one DN to another subtree.
string | Zend_Ldap_Dn | $from | |
string | Zend_Ldap_Dn | $to | |
boolean | $recursively |
Zend_Ldap_Exception |
count | ( | $filter, | |
$basedn = null , |
|||
$scope = self::SEARCH_SCOPE_SUB |
|||
) |
Count items found by given filter.
string | Zend_Ldap_Filter_Abstract | $filter | |
string | Zend_Ldap_Dn | null | $basedn | |
integer | $scope |
Zend_Ldap_Exception |
countChildren | ( | $dn | ) |
Count children for a given DN.
string | Zend_Ldap_Dn | $dn |
Zend_Ldap_Exception |
delete | ( | $dn, | |
$recursively = false |
|||
) |
Delete an LDAP entry.
string | Zend_Ldap_Dn | $dn | |
boolean | $recursively |
Zend_Ldap_Exception |
disconnect | ( | ) |
exists | ( | $dn | ) |
Check if a given DN exists.
string | Zend_Ldap_Dn | $dn |
Zend_Ldap_Exception |
|
static |
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 |
|
static |
string | $str | The string to escape. |
getBaseDn | ( | ) |
Gets the base DN under which objects of interest are located.
getBaseNode | ( | ) |
getBoundUser | ( | ) |
Get the currently bound user.
FALSE if no user is bound to the LDAP resource NULL if there has been an anonymous bind username of the currently bound user
getCanonicalAccountName | ( | $acctname, | |
$form = 0 |
|||
) |
string | $acctname | The name to canonicalize |
int | $type | The desired form of canonicalization |
Zend_Ldap_Exception |
getEntry | ( | $dn, | |
array | $attributes = array() , |
||
$throwOnNotFound = false |
|||
) |
Get LDAP entry by DN.
string | Zend_Ldap_Dn | $dn | |
array | $attributes | |
boolean | $throwOnNotFound |
Zend_Ldap_Exception |
getLastError | ( | & | $errorCode = null , |
array & | $errorMessages = null |
||
) |
Return the LDAP error message of the last LDAP command.
int | $errorCode | |
array | $errorMessages |
getLastErrorCode | ( | ) |
getNode | ( | $dn | ) |
Returns the specified DN as a Zend_Ldap_Node.
string | Zend_Ldap_Dn | $dn |
Zend_Ldap_Exception |
getOptions | ( | ) |
getResource | ( | ) |
getRootDse | ( | ) |
Returns the RootDSE.
Zend_Ldap_Exception |
getSchema | ( | ) |
Returns the schema.
Zend_Ldap_Exception |
move | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
Moves a LDAP entry from one DN to another DN.
This is an alias for rename()
string | Zend_Ldap_Dn | $from | |
string | Zend_Ldap_Dn | $to | |
boolean | $recursively | |
boolean | $alwaysEmulate |
Zend_Ldap_Exception |
moveToSubtree | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
Moves a LDAP entry from one DN to another subtree.
string | Zend_Ldap_Dn | $from | |
string | Zend_Ldap_Dn | $to | |
boolean | $recursively | |
boolean | $alwaysEmulate |
Zend_Ldap_Exception |
|
static |
Prepares an ldap data entry array for insert/update operation.
array | $entry |
InvalidArgumentException |
rename | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
Renames a LDAP entry from one DN to another DN.
This method implicitely moves the entry to another location within the tree.
string | Zend_Ldap_Dn | $from | |
string | Zend_Ldap_Dn | $to | |
boolean | $recursively | |
boolean | $alwaysEmulate |
Zend_Ldap_Exception |
save | ( | $dn, | |
array | $entry | ||
) |
Save entry to LDAP registry.
Internally decides if entry will be updated to added by calling exists().
string | Zend_Ldap_Dn | $dn | |
array | $entry |
Zend_Ldap_Exception |
search | ( | $filter, | |
$basedn = null , |
|||
$scope = self::SEARCH_SCOPE_SUB , |
|||
array | $attributes = array() , |
||
$sort = null , |
|||
$collectionClass = null , |
|||
$sizelimit = 0 , |
|||
$timelimit = 0 |
|||
) |
A global LDAP search routine for finding information.
Options can be either passed as single parameters according to the method signature or as an array with one or more of the following keys
string | Zend_Ldap_Filter_Abstract | array | $filter | |
string | Zend_Ldap_Dn | null | $basedn | |
integer | $scope | |
array | $attributes | |
string | null | $sort | |
string | null | $collectionClass | |
integer | $sizelimit | |
integer | $timelimit |
Zend_Ldap_Exception |
searchEntries | ( | $filter, | |
$basedn = null , |
|||
$scope = self::SEARCH_SCOPE_SUB , |
|||
array | $attributes = array() , |
||
$sort = null , |
|||
$reverseSort = false , |
|||
$sizelimit = 0 , |
|||
$timelimit = 0 |
|||
) |
Search LDAP registry for entries matching filter and optional attributes.
Options can be either passed as single parameters according to the method signature or as an array with one or more of the following keys
string | Zend_Ldap_Filter_Abstract | array | $filter | |
string | Zend_Ldap_Dn | null | $basedn | |
integer | $scope | |
array | $attributes | |
string | null | $sort | |
boolean | $reverseSort | |
integer | $sizelimit | |
integer | $timelimit |
Zend_Ldap_Exception |
setOptions | ( | $options | ) |
Sets the options used in connecting, binding, etc.
Valid option keys: host port useSsl username password bindRequiresDn baseDn accountCanonicalForm accountDomainName accountDomainNameShort accountFilterFormat allowEmptyPassword useStartTls optRefferals tryUsernameSplit
array | Zend_Config | $options | Options used in connecting, binding, etc. |
Zend_Ldap_Exception |
update | ( | $dn, | |
array | $entry | ||
) |
Update LDAP registry.
string | Zend_Ldap_Dn | $dn | |
array | $entry |
Zend_Ldap_Exception |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const ACCTNAME_FORM_BACKSLASH = 3 |
const ACCTNAME_FORM_DN = 1 |
const ACCTNAME_FORM_PRINCIPAL = 4 |
const ACCTNAME_FORM_USERNAME = 2 |
const SEARCH_SCOPE_BASE = 3 |
const SEARCH_SCOPE_ONE = 2 |
const SEARCH_SCOPE_SUB = 1 |