Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/ldaplib.php File Reference

Go to the source code of this file.

Namespaces

namespace  core

Functions

if(!defined('ROOTDSE')) ldap_supported_usertypes ()
 ldap_getdefaults ()
 ldap_isgroupmember ($ldapconnection, $userid, $group_dns, $member_attrib)
 ldap_connect_moodle ($host_url, $ldap_version, $user_type, $bind_dn, $bind_pw, $opt_deref, &$debuginfo)
 ldap_find_userdn ($ldapconnection, $username, $contexts, $objectclass, $search_attrib, $search_sub)
 ldap_get_entries_moodle ($ldapconnection, $searchresult)
 ldap_filter_addslashes ($text)
if(!defined('LDAP_DN_SPECIAL_CHARS'))
if(!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_NUM'))
if(!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA')) 
ldap_get_dn_special_chars ()
 ldap_addslashes ($text)
 ldap_stripslashes ($text)

Function Documentation

ldap_addslashes ( text)

Quote control characters in distinguished names used in LDAP - See RFC 4514/2253

Parameters:
stringThe text to quote
Returns:
string The text quoted

Definition at line 335 of file ldaplib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

ldap_connect_moodle ( host_url,
ldap_version,
user_type,
bind_dn,
bind_pw,
opt_deref,
&$  debuginfo 
)

Tries connect to specified ldap servers. Returns a valid LDAP connection or false.

Parameters:
string$host_url
integer$ldap_versioneither 2 (LDAPv2) or 3 (LDAPv3).
string$user_typethe configured user type for this connection.
string$bind_dnthe binding user dn. If an emtpy string, anonymous binding is used.
string$bind_pwthe password for the binding user. Ignored for anonymous bindings.
boolean$opt_derefwhether to set LDAP_OPT_DEREF on this connection or not.
string&$debuginfothe debugging information in case the connection fails.
Returns:
mixed connection result or false.

Definition at line 163 of file ldaplib.php.

Here is the caller graph for this function:

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

Parameters:
stringfilter string to quote
Returns:
string the filter string quoted

Definition at line 299 of file ldaplib.php.

Here is the caller graph for this function:

ldap_find_userdn ( ldapconnection,
username,
contexts,
objectclass,
search_attrib,
search_sub 
)

Search specified contexts for username and return the user dn like: cn=username,ou=suborg,o=org

Parameters:
mixed$ldapconnectiona valid LDAP connection.
mixed$usernameusername (external LDAP encoding, no db slashes).
array$contextscontexts to look for the user.
string$objectclassobjectlass of the user (in LDAP filter syntax).
string$search_attribthe attribute use to look for the user.
boolean$search_subwhether to search subcontexts or not.
Returns:
mixed the user dn (external LDAP encoding, no db slashes) or false

Definition at line 223 of file ldaplib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

if (!defined('LDAP_DN_SPECIAL_CHARS')) if (!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_NUM')) if (!defined('LDAP_DN_SPECIAL_CHARS_QUOTED_ALPHA')) ldap_get_dn_special_chars ( )

The order of the special characters in these arrays _IS IMPORTANT_. Make sure '\5C' (and '\') are the first elements of the arrays. Otherwise we'll double replace '\' with '\5C' which is Bad(tm)

Definition at line 321 of file ldaplib.php.

Here is the caller graph for this function:

ldap_get_entries_moodle ( ldapconnection,
searchresult 
)

Returns values like ldap_get_entries but is binary compatible and returns all attributes as array.

Parameters:
mixed$ldapconnectionA valid LDAP connection
mixed$searchresultA search result from ldap_search, ldap_list, etc.
Returns:
array ldap-entries with lower-cased attributes as indexes

Definition at line 266 of file ldaplib.php.

Here is the caller graph for this function:

Initializes needed variables for ldap-module

Uses names defined in ldap_supported_usertypes. $default is first defined as: $default['pseudoname'] = array( 'typename1' => 'value', 'typename2' => 'value' .... );

Returns:
array of default values

Definition at line 54 of file ldaplib.php.

Here is the caller graph for this function:

ldap_isgroupmember ( ldapconnection,
userid,
group_dns,
member_attrib 
)

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

Returns true if user belongs to a group in grupdns string OR if the DN of the user is in a subtree of the DN provided as "group"

Parameters:
mixed$ldapconnectionA valid LDAP connection.
string$useridLDAP user id (dn/cn/uid/...) to test membership for.
array$group_dnsarrary of group dn
string$member_attribthe name of the membership attribute.
Returns:
boolean

Definition at line 113 of file ldaplib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

ldap_stripslashes ( text)

Unquote control characters in distinguished names used in LDAP - See RFC 4514/2253

Parameters:
stringThe text quoted
Returns:
string The text unquoted

Definition at line 350 of file ldaplib.php.

Here is the call graph for this function:

if (!defined('ROOTDSE')) ldap_supported_usertypes ( )

Returns predefined user types

Returns:
array of predefined user types

Definition at line 30 of file ldaplib.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations