Issue Details (XML | Word | Printable)

Key: MDL-15039
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Iñaki Arenaza
Reporter: Michael Woods
Votes: 1
Watchers: 1
Operations

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

Apostrophes preventing any users in course being unenrolled via LDAP

Created: 29/May/08 02:09 PM   Updated: 14/Jun/08 08:37 PM
Return to search
Component/s: Enrolments
Affects Version/s: 1.8.2, 1.9
Fix Version/s: 1.8.6, 1.9.2

Environment: MS Active Directory

Database: MySQL
Participants: Iñaki Arenaza, Michael Blake, Michael Woods and Petr Skoda
Security Level: None
Resolved date: 14/Jun/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
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)).'\')';

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Michael Woods made changes - 30/May/08 09:42 AM
Field Original Value New Value
Affects Version/s 1.9 [ 10190 ]
Iñaki Arenaza made changes - 01/Jun/08 08:54 PM
Assignee Nobody [ nobody ] Iñaki Arenaza [ iarenaza ]
Iñaki Arenaza made changes - 03/Jun/08 06:41 AM
Status Open [ 1 ] In Progress [ 3 ]
Michael Blake made changes - 10/Jun/08 04:45 PM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Michael Blake made changes - 10/Jun/08 04:46 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Petr Skoda made changes - 10/Jun/08 11:15 PM
Fix Version/s 1.8.6 [ 10270 ]
Fix Version/s 1.9.2 [ 10280 ]
Iñaki Arenaza made changes - 14/Jun/08 08:37 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]