1089. Class

1089.1. Zend\Ldap\Ldap

1089.1.1. Methods

1089.1.1.1. __construct

__construct()

Constructor.

Parameters:array|Traversable – Options used in connecting, binding, etc.
Throws ExceptionLdapException:
 

1089.1.1.2. __destruct

__destruct()

Destructor.

Return type:void

1089.1.1.3. getResource

getResource()

@return resource The raw LDAP extension resource.

1089.1.1.4. getLastErrorCode

getLastErrorCode()

Return the LDAP error number of the last LDAP command

Return type:int

1089.1.1.5. getLastError

getLastError()

Return the LDAP error message of the last LDAP command

Parameters:
  • int
  • array
Return type:

string

1089.1.1.6. getBoundUser

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

Return type:bool|null|string

1089.1.1.7. setOptions

setOptions()

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
Parameters:array|Traversable – Options used in connecting, binding, etc.
Return type:Ldap Provides a fluent interface
Throws :ExceptionLdapException

1089.1.1.8. getOptions

getOptions()

@return array The current options.

1089.1.1.9. getHost

getHost()
@return string The hostname of the LDAP server being used to
authenticate accounts

1089.1.1.10. getPort

getPort()
@return int The port of the LDAP server or 0 to indicate that no port
value is set

1089.1.1.11. getUseSsl

getUseSsl()

@return bool The default SSL / TLS encrypted transport control

1089.1.1.12. getUsername

getUsername()

@return string The default acctname for binding

1089.1.1.13. getPassword

getPassword()

@return string The default password for binding

1089.1.1.14. getBindRequiresDn

getBindRequiresDn()

@return bool Bind requires DN

1089.1.1.15. getBaseDn

getBaseDn()

Gets the base DN under which objects of interest are located

Return type:string

1089.1.1.16. getAccountCanonicalForm

getAccountCanonicalForm()

@return integer Either ACCTNAME_FORM_BACKSLASH, ACCTNAME_FORM_PRINCIPAL or ACCTNAME_FORM_USERNAME indicating the form usernames should be canonicalized to.

1089.1.1.17. getAccountDomainName

getAccountDomainName()

@return string The account domain name

1089.1.1.18. getAccountDomainNameShort

getAccountDomainNameShort()

@return string The short account domain name

1089.1.1.19. getAccountFilterFormat

getAccountFilterFormat()

@return string A format string for building an LDAP search filter to match an account

1089.1.1.20. getAllowEmptyPassword

getAllowEmptyPassword()

@return bool Allow empty passwords

1089.1.1.21. getUseStartTls

getUseStartTls()

@return bool The default SSL / TLS encrypted transport control

1089.1.1.22. getOptReferrals

getOptReferrals()

@return bool Opt. Referrals

1089.1.1.23. getTryUsernameSplit

getTryUsernameSplit()

@return bool Try splitting the username into username and domain

1089.1.1.24. getNetworkTimeout

getNetworkTimeout()

@return int The value for network timeout when connect to the LDAP server.

1089.1.1.25. getAccountFilter

getAccountFilter()

@param string $acctname

Return type:string The LDAP search filter for matching directory accounts

1089.1.1.26. splitName

splitName()

@param string $name The name to split

Parameters:
  • string – The resulting domain name (this is an out parameter)
  • string – The resulting account name (this is an out parameter)
Return type:

void

1089.1.1.27. getAccountDn

getAccountDn()

@param string $acctname The name of the account

Return type:string The DN of the specified account
Throws :ExceptionLdapException

1089.1.1.28. isPossibleAuthority

isPossibleAuthority()

@param string $dname The domain name to check

Return type:bool

1089.1.1.29. getCanonicalAccountName

getCanonicalAccountName()

@param string $acctname The name to canonicalize

Parameters:int – The desired form of canonicalization
Return type:string The canonicalized name in the desired form
Throws :ExceptionLdapException

1089.1.1.30. getAccount

getAccount()

@param string $acctname

Parameters:array – An array of names of desired attributes
Return type:array An array of the attributes representing the account
Throws :ExceptionLdapException

1089.1.1.31. disconnect

disconnect()

@return Ldap Provides a fluent interface

1089.1.1.32. connect

connect()

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.

Parameters:
  • string – The hostname of the LDAP server to connect to
  • int – The port number of the LDAP server to connect to
  • bool – Use SSL
  • bool – Use STARTTLS
  • int – The value for network timeout when connect to the LDAP server.
Return type:

Ldap Provides a fluent interface

Throws :

ExceptionLdapException

1089.1.1.33. bind

bind()

@param string $username The username for authenticating the bind

Parameters:string – The password for authenticating the bind
Return type:Ldap Provides a fluent interface
Throws :ExceptionLdapException

1089.1.1.35. createCollection

createCollection()

Extension point for collection creation

Parameters:
  • CollectionDefaultIterator
  • string|null
Return type:

Collection

Throws :

ExceptionLdapException

1089.1.1.36. count

count()

Count items found by given filter.

Parameters:
  • string|FilterAbstractFilter
  • string|Dn|null
  • integer
Return type:

integer

Throws :

ExceptionLdapException

1089.1.1.37. countChildren

countChildren()

Count children for a given DN.

Parameters:string|Dn
Return type:integer
Throws :ExceptionLdapException

1089.1.1.38. exists

exists()

Check if a given DN exists.

Parameters:string|Dn
Return type:bool
Throws :ExceptionLdapException

1089.1.1.39. searchEntries

searchEntries()

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 - filter - baseDn - scope - attributes - sort - reverseSort - sizelimit - timelimit

Parameters:
  • string|FilterAbstractFilter|array
  • string|Dn|null
  • integer
  • array
  • string|null
  • bool
  • integer
  • integer
Return type:

array

Throws :

ExceptionLdapException

1089.1.1.40. getEntry

getEntry()

Get LDAP entry by DN

Parameters:
  • string|Dn
  • array
  • bool
Return type:

array

Throws :

null|ExceptionLdapException

1089.1.1.41. prepareLdapEntryArray

prepareLdapEntryArray()

Prepares an ldap data entry array for insert/update operation

Parameters:array
Throws ExceptionInvalidArgumentException:
 
Return type:void

1089.1.1.42. add

add()

Add new information to the LDAP repository

Parameters:
  • string|Dn
  • array
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.43. update

update()

Update LDAP registry

Parameters:
  • string|Dn
  • array
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.44. save

save()

Save entry to LDAP registry.

Internally decides if entry will be updated to added by calling {@link exists()}.

Parameters:
  • string|Dn
  • array
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.45. delete

delete()

Delete an LDAP entry

Parameters:
  • string|Dn
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.46. getChildrenDns

getChildrenDns()

Retrieve the immediate children DNs of the given $parentDn

This method is used in recursive methods like {@see delete()} or {@see copy()}

Parameters:string|Dn
Throws ExceptionLdapException:
 
Return type:array of DNs

1089.1.1.47. moveToSubtree

moveToSubtree()

Moves a LDAP entry from one DN to another subtree.

Parameters:
  • string|Dn
  • string|Dn
  • bool
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.48. move

move()

Moves a LDAP entry from one DN to another DN.

This is an alias for {@link rename()}

Parameters:
  • string|Dn
  • string|Dn
  • bool
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.49. rename

rename()

Renames a LDAP entry from one DN to another DN.

This method implicitly moves the entry to another location within the tree.

Parameters:
  • string|Dn
  • string|Dn
  • bool
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.50. copyToSubtree

copyToSubtree()

Copies a LDAP entry from one DN to another subtree.

Parameters:
  • string|Dn
  • string|Dn
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.51. copy

copy()

Copies a LDAP entry from one DN to another DN.

Parameters:
  • string|Dn
  • string|Dn
  • bool
Return type:

Ldap Provides a fluid interface

Throws :

ExceptionLdapException

1089.1.1.52. getNode

getNode()

Returns the specified DN as a ZendLdapNode

Parameters:string|Dn
Return type:Node|null
Throws :ExceptionLdapException

1089.1.1.53. getBaseNode

getBaseNode()

Returns the base node as a ZendLdapNode

Return type:Node
Throws :ExceptionLdapException

1089.1.1.54. getRootDse

getRootDse()

Returns the RootDse

Return type:NodeRootDse
Throws :ExceptionLdapException

1089.1.1.55. getSchema

getSchema()

Returns the schema

Return type:NodeSchema
Throws :ExceptionLdapException

1089.1.2. Constants

1089.1.2.1. SEARCH_SCOPE_SUB

1089.1.2.2. SEARCH_SCOPE_ONE

1089.1.2.3. SEARCH_SCOPE_BASE

1089.1.2.4. ACCTNAME_FORM_DN

1089.1.2.5. ACCTNAME_FORM_USERNAME

1089.1.2.6. ACCTNAME_FORM_BACKSLASH

1089.1.2.7. ACCTNAME_FORM_PRINCIPAL

Project Versions

Table Of Contents

Previous topic

1088. Class

Next topic

1090. Class

This Page