Moodle

Problem with LDAP enrolment when Course is hidden.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8, 1.8.1
  • Fix Version/s: 1.7.2, 1.8.2, 1.9
  • Component/s: Enrolments
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

Description

When Ldap enrolment is used and a course is hidden, and a user is a member of the group that is assigned to the hidden course, on login a user is presented with a "blank" page....or a php error if debug is right....

caused by the following code in enrol\ldap\enrol.php function setup_enrolments(&$user)

line 79:
if ($course_obj->visible==0 && $user->{$type}[$course_obj->id] == 'ldap') {

$type doesn't exist. - and $user doesn't contain anything that looks like a CourseObj->id with a setting of 'ldap' either....

replacing it with this works:

if ($course_obj->visible==0) {
but it doesn't check to see if the course is an Ldap enrolment type.....

does it need to check this?

Dan

Issue Links

Activity

Hide
Iñaki Arenaza added a comment -

No, it doesn't need that check. In fact, the check is wrong since the move to roles.

As I say in MDL-11098 (didn't see you bug repor before opening mine), all the courses have been checked to be LDAP based before reaching this line, so the check is both wrong and superfluous

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - No, it doesn't need that check. In fact, the check is wrong since the move to roles. As I say in MDL-11098 (didn't see you bug repor before opening mine), all the courses have been checked to be LDAP based before reaching this line, so the check is both wrong and superfluous Saludos. Iñaki.
Hide
Iñaki Arenaza added a comment -

This is a duplicate of MDL-11098, so closing now.

Thanks for the report

Show
Iñaki Arenaza added a comment - This is a duplicate of MDL-11098, so closing now. Thanks for the report

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: