Zend Framework
2.4
|
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, $networkTimeout=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. | |
getBaseNode () | |
Returns the base node as a Zend. | |
getRootDse () | |
Returns the RootDse. | |
getSchema () | |
Returns the schema. | |
Static Public Member Functions | |
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 () | |
getNetworkTimeout () | |
getAccountFilter ($acctname) | |
splitName ($name, &$dname, &$aname) | |
getAccountDn ($acctname) | |
isPossibleAuthority ($dname) | |
getAccount ($acctname, array $attrs=null) | |
createCollection (Collection\DefaultIterator $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 | Traversable | $options | Options used in connecting, binding, etc. |
Exception\LdapException |
__destruct | ( | ) |
Destructor.
add | ( | $dn, | |
array | $entry | ||
) |
bind | ( | $username = null , |
|
$password = null |
|||
) |
string | $username | The username for authenticating the bind |
string | $password | The password for authenticating the bind |
Exception\LdapException |
connect | ( | $host = null , |
|
$port = null , |
|||
$useSsl = null , |
|||
$useStartTls = null , |
|||
$networkTimeout = 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 |
bool | $useSsl | Use SSL |
bool | $useStartTls | Use STARTTLS |
int | $networkTimeout | The value for network timeout when connect to the LDAP server. |
Exception\LdapException |
copy | ( | $from, | |
$to, | |||
$recursively = false |
|||
) |
copyToSubtree | ( | $from, | |
$to, | |||
$recursively = false |
|||
) |
count | ( | $filter, | |
$basedn = null , |
|||
$scope = self::SEARCH_SCOPE_SUB |
|||
) |
Count items found by given filter.
string | Filter\AbstractFilter | $filter | |
string | Dn | null | $basedn | |
int | $scope |
Exception\LdapException |
countChildren | ( | $dn | ) |
Count children for a given DN.
string | Dn | $dn |
Exception\LdapException |
|
protected |
Extension point for collection creation.
Collection\DefaultIterator | $iterator | |
string | null | $collectionClass |
Exception\LdapException |
delete | ( | $dn, | |
$recursively = false |
|||
) |
disconnect | ( | ) |
exists | ( | $dn | ) |
Check if a given DN exists.
string | Dn | $dn |
Exception\LdapException |
|
protected |
string | $acctname | |
array | $attrs | An array of names of desired attributes |
Exception\LdapException |
|
protected |
|
protected |
string | $acctname | The name of the account |
Exception\LdapException |
|
protected |
|
protected |
|
protected |
string | $acctname |
|
protected |
|
protected |
getBaseDn | ( | ) |
Gets the base DN under which objects of interest are located.
|
protected |
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 | $form | The desired form of canonicalization |
Exception\LdapException |
|
protected |
getEntry | ( | $dn, | |
array | $attributes = array() , |
||
$throwOnNotFound = false |
|||
) |
Get LDAP entry by DN.
string | Dn | $dn | |
array | $attributes | |
bool | $throwOnNotFound |
null|Exception\LdapException |
|
protected |
getLastError | ( | & | $errorCode = null , |
array & | $errorMessages = null |
||
) |
Return the LDAP error message of the last LDAP command.
int | $errorCode | |
array | $errorMessages |
getLastErrorCode | ( | ) |
Return the LDAP error number of the last LDAP command.
|
protected |
getNode | ( | $dn | ) |
getOptions | ( | ) |
|
protected |
|
protected |
|
protected |
getResource | ( | ) |
getRootDse | ( | ) |
getSchema | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
string | $dname | The domain name to check |
move | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
moveToSubtree | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
|
static |
Prepares an ldap data entry array for insert/update operation.
array | $entry |
Exception\InvalidArgumentException |
rename | ( | $from, | |
$to, | |||
$recursively = false , |
|||
$alwaysEmulate = false |
|||
) |
save | ( | $dn, | |
array | $entry | ||
) |
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 | Filter\AbstractFilter | array | $filter | |
string | Dn | null | $basedn | |
int | $scope | |
array | $attributes | |
string | null | $sort | |
string | null | $collectionClass | |
int | $sizelimit | |
int | $timelimit |
Exception\LdapException |
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 | Filter\AbstractFilter | array | $filter | |
string | Dn | null | $basedn | |
int | $scope | |
array | $attributes | |
string | null | $sort | |
bool | $reverseSort | |
int | $sizelimit | |
int | $timelimit |
Exception\LdapException |
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 optReferrals tryUsernameSplit networkTimeout
array | Traversable | $options | Options used in connecting, binding, etc. |
Exception\LdapException |
|
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) |
update | ( | $dn, | |
array | $entry | ||
) |
|
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 |