|
|
|
Environment:
|
MS Active Directory
|
|
|
If any member of a course has an ID number containing an apostrophe (eg. CN=Paddy O'Brien,OU=Students,DC=etc...), no other members will ever be unenrolled via LDAP.
In enrol/ldap/enrol.php, this is due to the array $ldapmembers not accounting for apostrophes and therefore get_records_sql($sql) fails to return any members due to the resultant syntax error.
It doesn't just affect the name with an apostrophe - it affects any members of the same course.
We fixed by replacing the following code around line 264 (v1.8.2)
$sql .= 'AND usr.idnumber NOT IN (\''. join('\',\'', $ldapmembers).'\')';
with...
$sql .= 'AND usr.idnumber NOT IN (\''. join('\',\'', str_replace("'", "\'",$ldapmembers)).'\')';
|
|
Description
|
If any member of a course has an ID number containing an apostrophe (eg. CN=Paddy O'Brien,OU=Students,DC=etc...), no other members will ever be unenrolled via LDAP.
In enrol/ldap/enrol.php, this is due to the array $ldapmembers not accounting for apostrophes and therefore get_records_sql($sql) fails to return any members due to the resultant syntax error.
It doesn't just affect the name with an apostrophe - it affects any members of the same course.
We fixed by replacing the following code around line 264 (v1.8.2)
$sql .= 'AND usr.idnumber NOT IN (\''. join('\',\'', $ldapmembers).'\')';
with...
$sql .= 'AND usr.idnumber NOT IN (\''. join('\',\'', str_replace("'", "\'",$ldapmembers)).'\')'; |
Show » |
committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 03/Jun/08 06:33 AM
MDL-15039 Apostrophes in idnumber prevent users from being unenrolled via LDAP
If any member of a course has an ID number containing an apostrophe (eg.
CN=Paddy O'Brien,OU=Students,DC=etc...), no other members will ever be
unenrolled via LDAP.
Thanks to Michael Woods for the bug report and proposed solution.
|
|
|
committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 03/Jun/08 06:35 AM
MDL-15039 Apostrophes in idnumber prevent users from being unenrolled via LDAP
If any member of a course has an ID number containing an apostrophe (eg.
CN=Paddy O'Brien,OU=Students,DC=etc...), no other members will ever be
unenrolled via LDAP.
Thanks to Michael Woods for the bug report and proposed solution.
Merged from MOODLE_18_STABLE.
|
|
|
committed 1 file to 'Moodle CVS' - 03/Jun/08 06:39 AM
MDL-15039 Apostrophes in idnumber prevent users from being unenrolled via LDAP
If any member of a course has an ID number containing an apostrophe (eg.
CN=Paddy O'Brien,OU=Students,DC=etc...), no other members will ever be
unenrolled via LDAP.
Thanks to Michael Woods for the bug report and proposed solution.
Merged from MOODLE_18_STABLE.
|
|
|
|