moodle/enrol
peterbulmer d813bd8763 MDL19219 mnet, mitigate arrkey loss in transit
When usernames are numeric, they are lost in mnet transit when used as
keys in the array result of course_enrolments(). As the username is not
sent with the enrolment details, it was not previously recoverable.
This patch adds the information to the enrolment details,
(enrol/mnet/enrol.php), and adds support for recovering the username if
it was numeric (and hence lost) (admin/mnet/enr_course_enrol.php)
2009-05-18 02:42:18 +00:00
..
authorize Backporting MDL-16715 to 18_STABLE (new transid codes). Credit goes to Ethem Elvice. 2008-09-27 17:35:39 +00:00
database MDL-16043: manage case when administrator set enrol_remotecoursefield or enrol_remoteuserfield in UPPERCASE, merged from 19 2008-08-27 07:06:57 +00:00
flatfile Flatfile enrolment: MDL-11418 SQL error. Thanks to Patrick Pollet. 2008-12-15 02:53:44 +00:00
imsenterprise MDL-12783 IMS idon't unenroll students who were enrolled by other plug-ins 2008-06-08 15:28:08 +00:00
ldap MDL-15182 Fix LDAP enrolment course auto-creation at user login 2008-06-07 21:18:12 +00:00
manual MDL-10585: 2007-08-01 11:50:00 +00:00
mnet MDL19219 mnet, mitigate arrkey loss in transit 2009-05-18 02:42:18 +00:00
paypal MDL-11991 Fixing error on undefined method while using the manual plug-in. 2007-11-13 18:02:28 +00:00
enrol.class.php Changing error to notify so that it's not fatal (and doesn't leak server data) 2006-09-26 04:38:00 +00:00
index.html Stop people browsing enrolment modules 2005-01-23 04:17:41 +00:00
README.txt Updated some docs 2006-09-11 08:25:49 +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 5 minutes. 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