Address book backend for LDAP server
An array with the following elements must be passed to the class constructor (elements marked ? are optional)
Main settings:
host => LDAP server hostname, IP-address or any other URI compatible with used LDAP library. base => LDAP server root (base dn). Empty string allowed. ? port => LDAP server TCP port number (default: 389) ? charset => LDAP server charset (default: utf-8) ? name => Name for LDAP server (default "LDAP: hostname") Used to tag the result data ? maxrows => Maximum # of rows in search result ? timeout => Timeout for LDAP operations (in seconds, default: 30) Might not work for all LDAP libraries or servers. ? binddn => LDAP Bind DN. ? bindpw => LDAP Bind Password. ? protocol => LDAP Bind protocol.Advanced settings:
? filter => Filter expression to limit ldap search results. You can use this to *limit* the result set, based on specific requirements. The filter must be enclosed in parentheses, e.g.: '(objectclass=mailRecipient)' or '(&(objectclass=mailRecipient)(obectclass=myCustomClass))' The default value is empty. ? search_expression => Custom expression to expand ldap searches. This can help *expand* the result set, because of hits in more LDAP attributes. It must be a printf()-style string with either one placeholder '%s', or, if you want to repeat the expression many times, '%1$s'. The default value is: '(|(cn=*%1$s*)(mail=*%1$s*)(sn=*%1$s*))' that is, the search expression is search in the fields cn (common name), sn (surname) and mail. ? limit_scope => Limits scope to base DN (Specific to Win2k3 ADS). ? listing => Controls listing of LDAP directory. ? writeable => Controls write access to address book ? search_tree => Controls subtree or one level search. ? starttls => Controls use of StartTLS on LDAP connectionsNOTE. This class should not be used directly. Use addressbook_init() function instead.
Located in /functions/abook_ldap_server.php (line 79)
addressbook_backend | --abook_ldap_server
Inherited from addressbook_backend
addressbook_backend::$bnum
addressbook_backend::$error
Constructor (PHP4 style, kept for compatibility reasons)
Connects to the database
Constructor (PHP5 style, required in some future version of PHP)
Connects to the database
Add address
Decode from charset used by this LDAP server to charset used by translation
Uses SquirrelMail charset_decode functions
Encode string to the charset used by this LDAP server
Determine internal attribute name given one of the SquirrelMail SM_ABOOK_FIELD_* constants
Sanitizes ldap search strings.
See rfc2254
Add an entry to LDAP server.
Warning: You must make sure that the arguments are correctly formated and sanitize use of special ldap keywords.
Get error from LDAP resource if possible
Should get error from server using the ldap_errno() and ldap_err2str() functions
Modify the values of an entry on LDAP server.
Warning: You must make sure that the arguments are correctly formated and sanitize use of special ldap keywords.
Remove an entry from LDAP server.
Warning: You must make sure that the argument is correctly formated and sanitize use of special ldap keywords.
Rename an entry on LDAP server.
Warning: You must make sure that the arguments are correctly formated and sanitize use of special ldap keywords.
Search LDAP server.
Warning: You must make sure that ldap query is correctly formated and sanitize use of special ldap keywords.
List all entries present in LDAP server
maxrows setting might limit list of returned entries. Careful with this -- it could get quite large for big sites.
Lookup an address by the indicated field.
Modify address
Open the LDAP server.
Prepares user input for use in a ldap query.
Function converts input string to character set used in LDAP server (charset_encode() method) and sanitizes it (ldapspecialchars()).
Delete address
Search the LDAP server
Inherited From addressbook_backend
addressbook_backend::add()
addressbook_backend::fullname()
addressbook_backend::list_addr()
addressbook_backend::lookup()
addressbook_backend::modify()
addressbook_backend::remove()
addressbook_backend::search()
addressbook_backend::set_error()
Documentation generated on Mon, 13 Jan 2020 04:21:55 +0100 by phpDocumentor 1.4.3