Issue Details (XML | Word | Printable)

Key: MDL-8064
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Martin Dougiamas
Reporter: Jose Hales-Garcia
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Contextless login does not trigger auto enrollment

Created: 04/Jan/07 05:39 AM   Updated: 06/Jan/07 01:36 AM
Return to search
Component/s: Enrolments
Affects Version/s: 1.7
Fix Version/s: None

Environment: Probably not applicable but here it is anyway: Mac OS X 10.4.8; Intel Xserve Core2 3 GHz Xeon, 4 GB RAM; MySQL 5.0.24a; PHP 5.2.0

Database: MySQL
Participants: Jose Hales-Garcia, Martin Dougiamas and Paul Ortman
Security Level: None
Affected Branches: MOODLE_17_STABLE


 Description  « Hide
If student logs in using either the Login block or the login page they can authenticate but the auto-enrollment trigger is not executed. The My Courses block does not display their courses. (Course assignments are defined in a MySQL external database and authentication is done through LDAP.)

Workaround is for the student to first to click on the course's link, and then authenticate, after which point they get the "You are about to enrol... Are you sure..." message.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Jose Hales-Garcia added a comment - 05/Jan/07 08:08 PM
After further investigation, I need to make a correction and add more information.

First, the information. I wasn't explicit in saying that I'm using the MySQL external database plug-in. So maybe some of the environment information given may be pertinent.

As far as I can tell the bug appears to be occurring in the ADOdb library. In the file enrol/database/enrol.php, I found around line 65 (see snippet) that the $rs struct doesn't contain the proper data. The values of its results array are NULL. I haven't had time to bone up on ADOdb and delve further into it than this. If someone else doesn't do it before I get free, I'll eventually look into it.

if ($rs = $enroldb->Execute("SELECT {$CFG->enrol_remotecoursefield}
FROM {$CFG->enrol_dbtable}
WHERE {$CFG->enrol_remoteuserfield} = " . $useridfield .
(isset($remote_role_name, $remote_role_value) ? ' AND '.$remote_role_name.' = '.$remote_role_value : ''))) {

As for the correction. The student's ability to enroll themselves was due to not having an enrolment key set on the course (duh). So, when the enrolment key is set, the student is required to enter the key, even though they are in the enrollment table. This negates the advantage of using external enrollment tables at this time.


Paul Ortman added a comment - 05/Jan/07 11:15 PM
I fought a similar bug MDL-7655 and was mucking around in the code you highlighted in comment #1. Perhaps that is biting you as well?

Jose Hales-Garcia added a comment - 06/Jan/07 01:36 AM
Thank you Paul. This indeed was the issue.

I applied only the part of the patch relating to enrol.php (I'm not doing database authentication).