Moodle  2.2.1
http://www.collinsharper.com
enrol_ldap_plugin Class Reference
Inheritance diagram for enrol_ldap_plugin:
Collaboration diagram for enrol_ldap_plugin:

Public Member Functions

 __construct ()
 instance_deleteable ($instance)
 sync_user_enrolments ($user)
 sync_enrolments ()
 create_course ($course_ext, $skip_fix_course_sortorder=false)

Protected Member Functions

 ldap_connect ()
 ldap_close ()
 find_ext_enrolments ($ldapconnection, $memberuid, $role)
 ldap_find_userdn ($ldapconnection, $userid)
 ldap_find_user_groups ($ldapconnection, $memberdn)
 ldap_find_user_groups_recursively ($ldapconnection, $memberdn, &$membergroups)
 ldap_explode_group ($ldapconnection, $group, $memberattribute)

Protected Attributes

 $enrol_localcoursefield = 'idnumber'
 $enroltype = 'enrol_ldap'
 $errorlogtag = '[ENROL LDAP] '

Detailed Description

Definition at line 33 of file lib.php.


Constructor & Destructor Documentation

Constructor for the plugin. In addition to calling the parent constructor, we define and 'fix' some settings depending on the real settings the admin defined.

Definition at line 43 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

create_course ( course_ext,
skip_fix_course_sortorder = false 
)

Will create the moodle course from the template course_ext is an array as obtained from ldap -- flattened somewhat NOTE: if you pass true for $skip_fix_course_sortorder you will want to call fix_course_sortorder() after your are done with course creation.

Parameters:
array$course_ext
boolean$skip_fix_course_sortorder
Returns:
mixed false on error, id for the newly created course otherwise.

Definition at line 882 of file lib.php.

Here is the call graph for this function:

find_ext_enrolments ( ldapconnection,
memberuid,
role 
) [protected]

Return multidimensional array with details of user courses (at least dn and idnumber).

Parameters:
resource$ldapconnectiona valid LDAP connection.
string$memberuiduser idnumber (without magic quotes).
objectrole is a record from the mdl_role table.
Returns:
array

Definition at line 636 of file lib.php.

Here is the call graph for this function:

instance_deleteable ( instance)

Is it possible to delete enrol instance via standard UI?

Parameters:
object$instance
Returns:
bool

Reimplemented from enrol_plugin.

Definition at line 111 of file lib.php.

Here is the call graph for this function:

ldap_close ( ) [protected]

Disconnects from a LDAP server

Definition at line 619 of file lib.php.

ldap_connect ( ) [protected]

Connect to the LDAP server, using the plugin configured settings. It's actually a wrapper around ldap_connect_moodle()

Returns:
mixed A valid LDAP connection or false.

Definition at line 584 of file lib.php.

Here is the call graph for this function:

ldap_explode_group ( ldapconnection,
group,
memberattribute 
) [protected]

Given a group name (either a RDN or a DN), get the list of users belonging to that group. If the group has nested groups, expand all the intermediate groups and return the full list of users that directly or indirectly belong to the group.

Parameters:
resource$ldapconnectiona valid LDAP connection
string$groupthe group name to search
string$memberattibutethe attribute that holds the members of the group
Returns:
array the list of users belonging to the group. If $group is not actually a group, returns array($group).

Definition at line 831 of file lib.php.

Here is the call graph for this function:

ldap_find_user_groups ( ldapconnection,
memberdn 
) [protected]

Find the groups a given distinguished name belongs to, both directly and indirectly via nested groups membership.

Parameters:
resource$ldapconnectiona valid LDAP connection
string$memberdndistinguished name to search
Returns:
array with member groups' distinguished names (can be emtpy)

Definition at line 774 of file lib.php.

ldap_find_user_groups_recursively ( ldapconnection,
memberdn,
&$  membergroups 
) [protected]

Recursively process the groups the given member distinguished name belongs to, adding them to the already processed groups array.

Parameters:
resource$ldapconnection
string$memberdndistinguished name to search
arrayreference &$membergroups array with already found groups, where we'll put the newly found groups.

Definition at line 791 of file lib.php.

Here is the call graph for this function:

ldap_find_userdn ( ldapconnection,
userid 
) [protected]

Search specified contexts for the specified userid and return the user dn like: cn=username,ou=suborg,o=org. It's actually a wrapper around ldap_find_userdn().

Parameters:
resource$ldapconnectiona valid LDAP connection
string$useridthe userid to search for (in external LDAP encoding, no magic quotes).
Returns:
mixed the user dn or false

Definition at line 754 of file lib.php.

Here is the call graph for this function:

Forces synchronisation of all enrolments with LDAP server. It creates courses if the plugin is configured to do so.

Returns:
void

Definition at line 299 of file lib.php.

Here is the call graph for this function:

sync_user_enrolments ( user)

Forces synchronisation of user enrolments with LDAP server. It creates courses if the plugin is configured to do so.

Parameters:
object$useruser record
Returns:
void

Reimplemented from enrol_plugin.

Definition at line 131 of file lib.php.

Here is the call graph for this function:


Field Documentation

$enrol_localcoursefield = 'idnumber' [protected]

Definition at line 34 of file lib.php.

$enroltype = 'enrol_ldap' [protected]

Definition at line 35 of file lib.php.

$errorlogtag = '[ENROL LDAP] ' [protected]

Definition at line 36 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations