moodle/enrol
2011-01-06 10:20:28 +08:00
..
authorize MDL-24321 switching to stdClass in /e*/ 2010-09-21 08:14:41 +00:00
category improved spelling 2010-09-18 12:31:20 +00:00
cohort MDL-24276 reversed order of roles 2010-09-19 10:49:24 +00:00
database MDL-25674 detection of invalid $user parameter when synchronising user enrolments 2010-12-20 14:41:18 +01:00
flatfile MDL-24321 switching to stdClass in /e*/ 2010-09-21 08:14:41 +00:00
guest navigation MDL-25142 Fixed up differences in navigation between guest and normal user. 2010-11-11 03:37:56 +00:00
imsenterprise MDL-25536 fixed incorrect reading of plugin options in imsenterprise enrol plugin 2010-12-06 05:52:55 +00:00
ldap MDL-25813 fixed silly typo 2010-12-28 22:33:26 +01:00
manual MDL-20447: add page heading 2010-10-18 03:03:56 +00:00
meta enrol/meta MDL-25808 - error when deleting metacourse 2010-12-30 15:10:32 +00:00
mnet fixed wrong exception name 2010-09-17 12:32:26 +00:00
paypal MDL-24321 switching to stdClass in /e*/ 2010-09-21 08:14:41 +00:00
self message MDL-24860 fixed messaging code in mod_lesson and marked spots that are directly sending email 2010-12-22 12:05:49 +08:00
yui Yet another string using proper placeholder in Javascript 2010-11-17 12:44:17 +00:00
ajax.php enrol-users MDL-24618 Enrol users search now concats firstname and lastname as requested and searches email. 2010-11-11 01:49:58 +00:00
externallib.php webservice MDL-23943 fix moodle_enrol_get_enrolled_users (return function, return value, sql result not unique, param name never used) + add unit test 2010-08-30 07:48:09 +00:00
index.php enrolment MDL-23669 Added missing call to $PAGE->set_course from enrol/index.php 2010-08-05 02:24:39 +00:00
instances.php NOBUG: Added page heading 2010-09-23 05:37:00 +00:00
locallib.php enrol MDL-25522 Fixed up duplicate fields in search_other_users method that was causing problems in Oracle 2011-01-06 10:20:28 +08:00
otherusers.php enrol MDL-23688 added missing argument to table::set_fields 2010-08-06 02:11:01 +00:00
README.txt MDL-25147 tidy up readme wording related to cron 2010-11-11 00:24:43 +00:00
renderer.php MDL-23708 removing ENrol cohort button when no cohort visible by user or user not allowed to use it 2010-08-09 07:35:35 +00:00
users.php MDL-23502 fixed package info 2010-07-31 13:48:27 +00:00
users_forms.php MDL-23502 oops, die()! 2010-07-31 20:30:29 +00:00

ENROLMENT MODULES
-----------------

(Yes, that's the correct English spelling  ;-) )

enrol.class.php contains a simple 'factory' method that
will instantiate your class when called. For an example
of a complete class, take a look at the 'manual' class.

Each plugin is in a subfolder here.

Except for the configuration methods, most methods
defined in the API are optional -- callers will use
method_exists() to determine whether your plugin offers
the functionality they are after.


Mandatory methods
=================

  config_form()
  process_config()


Login-time methods
==================

  Before Moodle 1.7
  -----------------

      get_student_courses()
      get_teacher_courses()

  You probably will want to offer at least get_student_courses().

  These methods are triggered when a user logs in successfully,
  and they are expected to populate $USER->student and
  $USER->teacher arrays and maintain (add/delete) entries from
  user_students and user_teachers.

  These methods are relevant for most plugins, and are the main
  interest for plugins that work with a read-only backend such
  as LDAP or a database.

  Note that with the multi-enrol infrastructure two things have
  changed. We now have an 'enrol' field in those tables, and
  each plugin must maintain only its own enrolment records.
  Conversely, the $USER->student and ->teacher arrays have the
  enrolment type as value, like

     $USER->student = array ( $courseid => $plugintype );


  Moodle 1.7 and later
  --------------------

      setup_enrolments()

  With the advent of roles, there could well not be students and
  teachers any more, so enrolment plugins have to be more flexible
  about how they map outside data to the internal roles.

  This one method should do everything, calling functions from
  lib/accesslib.php as necessary to set up relationships.


Interactive enrolment methods
=============================

  print_entry()
  check_entry()
  check_group_entry()
  get_access_icons()

These methods are for enrolment plugins that allow for user
driven enrolment. These methods are relevant for plugins
that implement payment gateways (credit card, paypal),
as well as "magic password" schemes.

Only one interactive enrolment method can be active for
a given course. The site default can be set from
Admin->Enrolment, and then individual courses can be
set to specific interactive enrolment methods.


Cron
====

If your class offers a cron() method, it will be invoked by
the standard Moodle cron every time it is called. Note that if the
tasks are not lightweight you must control how frequently they
execute, perhaps offering a config option.

For really heavy cron processing, an alternative is to have
a separate script to be called separately. Currently the LDAP
and DB plugins have external scripts.


Guilty Parties
--------------

Martin Dougiamas and Shane Elliott, Moodle.com
Martin Langhoff and Patrick Li, Catalyst IT