Issue Details (XML | Word | Printable)

Key: MDL-7071
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Ian Fogarty
Votes: 1
Watchers: 2
Operations

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

LDAP Authentication with MS AD does not work when apostrophes are present in usernames

Created: 18/Oct/06 06:00 PM   Updated: 05/Mar/07 08:19 PM
Return to search
Component/s: Authentication
Affects Version/s: 1.5.4, 1.6, 1.6.1
Fix Version/s: 1.8, 1.9

Environment: Windows 2000 IIS5, PHP 5.1.4, MySQL 5.0.22-community-nt, MS Active Directory
Issue Links:
Dependency
 

Database: MySQL
URL: http://moodle.org/mod/forum/discuss.php?d=54901
Participants: Ian Fogarty and Petr Skoda
Security Level: None
Resolved date: 05/Mar/07
Affected Branches: MOODLE_15_STABLE, MOODLE_16_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
Authentication using LDAP (Active Directory) fails when trying to login using a username containing an apostrophe (') (i.e. sean o'neill). Returns error stating invalid username and re-presents username with apostrpohe escaped i.e. sean o\'neill.

To resolve this, instructions provided by Iñaki Arenaza in Forum Post 54901 (http://moodle.org/mod/forum/discuss.php?d=54901) involved removing escape character (\) before submitting query to LDAP. This was modified in <moodle>\auth\ldap\lib.php

As part of this solution, the user profile page had to be modifed, as described in Forum Post 55083 (http://moodle.org/mod/forum/discuss.php?d=55083).

After applying the fix stated above, our production server was able to process usernames with apostrophes via LDAP.

To reproduce
===========

1. Create a new user in Active Directory with an apostrophe in the username (i.e. sean o'neill)
2. Wait for replication etc around network and then try to login with that username to moodle

Expected result
============

User is logged in to Moodle as per normal

Actual result
==========

Username/Password is invalid error.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 01/Mar/07 07:14 PM
this hould be fixed in 1.8dev cvs, could you please test it and confirm?

Petr Skoda added a comment - 05/Mar/07 08:19 PM
closing now, should be fixed in 1.8
please file a new report for problems in 1.8 if needed

thanks for the report!