moodle/enrol
Aparup Banerjee 8be5407bc1 Merge branch 'w35_MDL-35064_m24_delenrol' of git://github.com/skodak/moodle
Conflicts:
	enrol/manual/locallib.php
2012-08-29 13:46:04 +08:00
..
authorize MDL-34557 accessibility compliance for enrol: Add forform input text and select tag 2012-08-03 11:53:46 +08:00
category MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
cohort MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
database MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
flatfile MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
guest MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
imsenterprise MDL-31973 Groups: groups_members table should have 'component', 'itemid' fields 2012-08-24 15:30:13 +01:00
ldap MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
manual Merge branch 'w35_MDL-35064_m24_delenrol' of git://github.com/skodak/moodle 2012-08-29 13:46:04 +08:00
meta MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
mnet MDL-34461 Librairies: Replaced deprecated get_context_instance() 2012-07-23 17:42:05 +08:00
paypal MDL-34853 use new duration setting type in enrol_paypal 2012-08-22 03:00:12 +02:00
self Merge branch 'w35_MDL-35070_m24_selfcleanup' of git://github.com/skodak/moodle 2012-08-28 21:05:26 +02:00
yui MDL-29007 Rename moodle-enrol-notification to moodle-core-notification 2012-07-25 16:22:18 +01:00
ajax.php MDL-35052 show all enrolled users in enrol UI included those enrolled via disabled plugins 2012-08-26 16:28:18 +02:00
bulkchange.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08:00
bulkchange_forms.php MDL-26770 enrol - Added support for bulk operations by enrol plugins 2011-04-21 10:13:13 +08:00
externallib.php MDL-34549 libraries: Changing strictness of context::instance_by_id() when required 2012-08-24 11:30:35 +08:00
index.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08:00
instances.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08:00
locallib.php MDL-35052 show all enrolled users in enrol UI included those enrolled via disabled plugins 2012-08-26 16:28:18 +02:00
otherusers.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08:00
README.txt MDL-25147 tidy up readme wording related to cron 2010-11-11 00:24:43 +00:00
renderer.php MDL-35052 show all enrolled users in enrol UI included those enrolled via disabled plugins 2012-08-26 16:28:18 +02:00
unenroluser.php MDL-30945 add support for unenrolling of individual users + code cleanup 2011-12-28 16:56:46 +01:00
upgrade.txt MDL-35052 show all enrolled users in enrol UI included those enrolled via disabled plugins 2012-08-26 16:28:18 +02:00
users.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08:00
users_forms.php Merge branch 'MDL-34461-master-integration' of git://github.com/FMCorz/moodle 2012-07-24 17:08:13 +08: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