48 Commits

Author SHA1 Message Date
stronk7
5ba3928959 Fixed two places where course->shortname was harcoded to 15. MDL-10026 2007-08-08 19:39:56 +00:00
thepurpleblob
61fbd0fb52 MDL-10396:
Add an option and a check to (optionally) prevent users being enrolled
in hidden courses.

Merged from STABLE_18
2007-07-20 13:03:19 +00:00
thepurpleblob
830ba6ea46 MDL-10157:
Turn the diagnostic prints into error_logs. The more normal "course skipped"
message now requires DEBUG_ALL or greater before it is generated at all.

Merged from STABLE_18
2007-07-20 08:57:05 +00:00
thepurpleblob
bf98228ade Missing cvs id tag 2007-06-18 10:35:02 +00:00
skodak
13569fd43b MDL-9418 use proper addslashes before each insert; merged from MOODLE_18_STABLE 2007-05-16 20:08:26 +00:00
nicolasconnault
a2ff2e0992 MDL-9207 Changed $extcourse to $coursefield in lines 92 to 111 2007-04-05 01:54:44 +00:00
toyomoyo
96c50eddd7 applying inaki's patch for MDL-9012, course autocreation doesn't work in enrol/database 2007-03-26 06:51:17 +00:00
nicolasconnault
20576b84af MDL-8693 Fixed the double-equal typos (2) 2007-03-01 07:34:51 +00:00
moodler
6ba65fa08d Merged Nicolas' changes from MDL-8582 into HEAD. 2007-02-28 06:25:22 +00:00
moodler
19a9bf1b8f Merged some fixes for MDL-8285 from stable 2007-02-23 06:47:19 +00:00
toyomoyo
537ea84763 MDL-8290, fix for broken plugins 2007-02-09 07:47:14 +00:00
stronk7
7cd5208507 Applying new rs_xxx() functions everywhere. MDL-8134
Merged from MOODLE_17_STABLE
2007-01-29 23:56:55 +00:00
stronk7
2c08b2514c Applying new rs_xxx() functions everywhere. MDL-8134
Merged from MOODLE_17_STABLE
2007-01-29 12:10:19 +00:00
martinlanghoff
d256515fba enrol/database: fix fields not read from external database MDL-7712 2007-01-15 19:57:12 +00:00
stronk7
93901eb42f Change some connections to non-persistent and force new connections
to avoid mysql (and oracle, I think) reuse of the main one. MDL-8152
2007-01-11 20:08:00 +00:00
toyomoyo
3f5abcb20a accessibility fixes 2006-12-14 07:48:40 +00:00
skodak
eb7ac7fc00 MDL-7806 Login results in fatal PHP error on enrol/database connect failure (patch by Clinton Graham) 2006-12-06 09:49:05 +00:00
stronk7
db15d4375e Fetchmode needs to be explicity set to ASSOC. Plus 1 missing library
added. MDL-7443

Merged from MOODLE_17_STABLE
2006-11-13 22:49:30 +00:00
stronk7
f9ec4d3722 Adding support for the new mssql_n driver
Merged from MOODLE_17_STABLE
2006-10-19 18:29:47 +00:00
martinlanghoff
f5896f0fb6 enrol/db/enrol.php ignore delt'd usrs when enroling
Previously the import process would throw a non-fatal error when it found a
non-one number of users with the remote key.  This meant that
when there was a deleted user with the same remote key as an existing user, it
would throw an error, and report that there were no users for that remote key.
Fixed it so that it now ignores deleted users, and provides more accurate
and more precise error messages in the event that there are further
problems.

Author: Peter Bulmer
2006-09-28 01:20:42 +00:00
mjollnir_
7ccf89f50a update enrol/database to use roles.
Credit: Alastair Pharo <alastair@catalyst.net.nz>

Database
--------

1) This plugin previously only worked for students.  I have made it so
that you can _optionally_ specify a third column in your external
database that contains some kind of role information (similar to the
other two fields, you can choose any column in the mdl_role table
to map to).  If you do this, then the code loops over for each different
kind of role and queries the external database.

2) There is a *slight* problem to be aware of, if a moodle
configuration was upgraded to use the new role columns, then downgraded
again, some roles might get left behind in the database when the
large-scale sync thing goes through (that is, record pruning doesn't
scale back quite properly). These would be cleaned away by
setup_enrolments at login time, however, and the scenario was unlikely
enough for me to decide to leave it for now.

3) If you don't have role columns there is a 'default role' setting
that you can set (made by Martin D).  This will only be obeyed when no
role columns are specified.  If this is set to 'default', then the
course default role is used, on a per-course basis (which usually
means student apparently).

4) From (3), my understanding is that if no config settings are
changed, and the default role for all upgraded courses is student, that
a smooth upgrade to 1.7 will occur for users of the database enrolment
plugin.
2006-09-26 01:30:32 +00:00
moodler
946cbe7029 Added some docs 2006-09-19 16:38:53 +00:00
moodler
6051c68d4b Deleted the old students-based function and created the
new-style setup_enrolments() function that uses roles
to do the tasks required when a user logs in.

Other enrolment plugins should use this as an example/guide

The sync parts of this plugin are not yet fixed.
2006-09-19 16:29:43 +00:00
moodler
0e1cc9070b Fixed a some debugging statements 2006-09-18 13:24:45 +00:00
martinlanghoff
74da3c2c89 [multienrol]Improved get_student/teacher_courses() functions to cache enrolment type that saves lots of recursive database query 2006-03-09 03:15:42 +00:00
martinlanghoff
f9667a5aea [multienrol]Initial commit for multi enrolment plugin feature 2006-03-09 02:48:29 +00:00
martinlanghoff
5f8ca5dfb6 enrol/db: Better warning when the user record is missing. 2006-01-16 03:12:55 +00:00
martinlanghoff
6ee745f7ec enrol/database: Fix for stupid SQL escaping error. 2006-01-16 03:12:10 +00:00
martinlanghoff
2642328505 enrol/database -- course autocreation now follows new configuration variables 2006-01-16 03:11:46 +00:00
martinlanghoff
32d9287f89 enrol/database -- added options to control course autocreation 2006-01-16 03:10:39 +00:00
martinlanghoff
e1c1a4a88f enrol/database - added some headers to the config page 2006-01-16 03:09:32 +00:00
martinlanghoff
491651f448 enrol/database - now with added sync and course autocreation
Added an external script to invoke automatic enrol-unenrol. It also
will autocreate courses based on a template.
2006-01-16 03:08:50 +00:00
martinlanghoff
92ab8e50d4 enrol/database tidyup: cleanup mysql hack if connect errors out 2006-01-16 03:04:31 +00:00
martinlanghoff
3e353d3622 enrol/database tidyup: wrap one line 2006-01-16 03:03:59 +00:00
martinlanghoff
388cbbfb8e enrol/database: split out db connection/disconnection to separate methods
Split them out in preparation for a sync method -- encapsulates the
nasty MySQL hack.
2006-01-16 03:03:21 +00:00
martinlanghoff
8456874ab3 Merged from MOODLE_15_STABLE - Fix for bug 4031 -- fix typo 2005-09-07 23:24:29 +00:00
martinlanghoff
a96354b582 Merged from MOODLE_15_STABLE - Fix for bug 4031 -- stupid mistake of using get_record_select() when I mean get_record() - see the bug entry for more details 2005-09-07 22:49:32 +00:00
martinlanghoff
e91902556f Merged from MOODLE_15_STABLE - enrol/db - bug 3912 - Re-add the enrolment to $user->student[] - should fix things for good. 2005-09-07 06:39:30 +00:00
martinlanghoff
fd734f6165 Merged from MOODLE_15_STABLE - Fix for bug 4011 -- a MySQL specific workaround did not work with database names with hyphens, and broke the whole plugin for other databases. This patch fixes both issues. 2005-09-07 06:12:40 +00:00
martinlanghoff
a6d114e600 Merged from MOODLE_15_STABLE - enrolment fixes: We now have better handling of the enrol field when dealing with student enrolments. This fixes bugs 3912 and 3974. NOTE that enrol_student() now defaults to manual - this is to support the different pages that call enrol_student() to still work correctly when external enrolments are in use, by recording the enrolments as manual. Enrolment plugins are expected to know better and pass the correct parameter. 2005-08-26 06:11:38 +00:00
stronk7
894ff63f8f Tabs are out 2005-05-16 22:22:31 +00:00
moodler
210eddc7df Various cleanups for XHTML and so on 2005-02-08 17:56:22 +00:00
moodler
ea8dedc882 Merged change to restore $CFG->prefix from stable 2004-09-25 15:33:06 +00:00
moodler
a3224cc359 Merged improved database plugin for enrolment 2004-09-23 17:02:40 +00:00
moodler
76706cbfb0 iMerged from stable 2004-09-03 03:19:31 +00:00
moodler
64eba17e78 Fixed a typo 2004-08-23 12:04:55 +00:00
moodler
0f093efab2 Here finally is an admin interface for controlling the new enrolment plugins.
It's not at all well-tested yet (I made a lot of changes to it just tonight)
but it's late and I am literally sick (with flu) and tired so I'm checking
this in and going to bed.

Please fix all the bugs for me.   ;-)
2004-08-21 17:15:07 +00:00
moodler
1357be4a55 Old code, never checked in ... not really tested 2004-08-14 12:47:24 +00:00