Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

LDAP API

From MoodleDocs
Revision as of 06:30, 24 May 2017 by John Okely (talk | contribs) (Begin a summary of LDAP API)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The LDAP API enables it is used by LDAP authentication module and LDAP enrolment

To use it, require lib/ldaplib.php

Functions

ldap_supported_usertype

Returns predefined user types

ldap_getdefaults

Initializes needed variables for ldap-module

ldap_isgroupmember

Checks if user belongs to specific group(s) or is in a subtree

ldap_connect_moodle

Tries connect to specified ldap servers

ldap_find_userdn

Search specified contexts for username and return the user dn

ldap_normalise_objectclass

Normalise the supplied objectclass filter. This normalisation is a rudimentary attempt to format the objectclass filter correctly.

ldap_get_entries_moodle

Returns values like ldap_get_entries but is binary compatible and returns all attributes as array. This will return lower case entries.

ldap_filter_addslashes

Quote control characters in texts used in LDAP filters - see RFC 4515/2254

ldap_get_dn_special_chars

Returns the special characters in order of replacement

ldap_addslashes

Quote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253

ldap_stripslashes

Unquote control characters in AttributeValue parts of a RelativeDistinguishedName used in LDAP distinguished names - See RFC 4514/2253

ldap_paged_results_supported

Check if we can use paged results (see RFC 2696). We need to use LDAP version 3 (or later), otherwise the server cannot use them. If we also pass in a valid LDAP connection handle, we also check whether the server actually supports them.