Moodle  2.2.1
http://www.collinsharper.com
enrol_mnet_mnetservice_enrol Class Reference

Public Member Functions

 available_courses ()
 user_enrolments ()
 enrol_user (array $userdata, $courseid)
 unenrol_user ($username, $courseid)
 course_enrolments ($courseid, $roles=null)

Detailed Description

MNet server-side methods that are part of mnetservice_enrol

The weird name of the class tries to follow a pattern {plugintype}_{pluginnname}_mnetservice_{servicename}

Class methods are compatible with API 1 of the service used by Moodle 1.x and 2.0 peers. The API version might become a part of class name but it is not neccessary due to how xml-rcp methods are/will be mapped to php methods.

Definition at line 47 of file enrol.php.


Member Function Documentation

Returns list of courses that we offer to the caller for remote enrolment of their users

Since Moodle 2.0, courses are made available for MNet peers by creating an instance of enrol_mnet plugin for the course. Hidden courses are not returned. If there are two instances - one specific for the host and one for 'All hosts', the setting of the specific one is used. The id of the peer is kept in customint1, no other custom fields are used.

mnet_remote_client Callable via XML-RPC only

Returns:
array

Definition at line 60 of file enrol.php.

Here is the call graph for this function:

Here is the caller graph for this function:

course_enrolments ( courseid,
roles = null 
)

Returns a list of users from the client server who are enrolled in our course

Suitable instance of enrol_mnet must be created in the course. This method will not return any information about the enrolments in courses that are not available for remote enrolment, even if their users are enrolled into them via other plugin (note the difference from self::user_enrolments()).

This method will return enrolment information for users from hosts regardless the enrolment plugin. It does not matter if the user was enrolled remotely by their admin or locally. Once the course is available for remote enrolments, we will tell them everything about their users.

In Moodle 1.x the returned array used to be indexed by username. The side effect of MDL-19219 fix is that we do not need to use such index and therefore we can return all enrolment records. MNet clients 1.x will only use the last record for the student, if she is enrolled via multiple plugins.

mnet_remote_client Callable via XML-RPC only

Parameters:
int$courseidID of our course
string | array$rolescomma separated list of role shortnames (or array of them)
Returns:
array

Definition at line 314 of file enrol.php.

Here is the call graph for this function:

enrol_user ( array userdata,
courseid 
)

Enrol remote user to our course

If we do not have local record for the remote user in our database, it gets created here.

mnet_remote_client Callable via XML-RPC only

Parameters:
array$userdatauser details {
See also:
mnet_fields_to_import()}
Parameters:
int$courseidour local course id
Returns:
bool true if the enrolment has been successful, throws exception otherwise

Definition at line 128 of file enrol.php.

Here is the call graph for this function:

unenrol_user ( username,
courseid 
)

Unenrol remote user from our course

Only users enrolled via enrol_mnet plugin can be unenrolled remotely. If the remote user is enrolled into the local course via some other enrol plugin (enrol_manual for example), the remote host can't touch such enrolment. Please do not report this behaviour as bug, it is a feature ;-)

mnet_remote_client Callable via XML-RPC only

Parameters:
string$usernameof the remote user
int$courseidof our local course
Returns:
bool true if the unenrolment has been successful, throws exception otherwise

Definition at line 211 of file enrol.php.

Here is the call graph for this function:

This method has never been implemented in Moodle MNet API

mnet_remote_client Callable via XML-RPC only

Returns:
array empty array

Definition at line 108 of file enrol.php.

Here is the call graph for this function:


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