Closed (won't fix)
Project:
Lightweight Directory Access Protocol
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Nov 2011 at 16:03 UTC
Updated:
11 Mar 2016 at 03:47 UTC
Jump to comment: Most recent
Comments
Comment #1
johnbarclay commentedTry this, in the server configuration under: "PHP to transform Drupal login username to LDAP UserName attribute," add:
print str_replace('.', '_', $name);This would turn what the user typed in from mary.dr to mary_dr
If this works, can you add it to the list of cases at: http://drupal.org/node/1065900
If it doesn't can you followup? This seems like a very basic use case that needs to be resolved as soon as possible.
Comment #2
johnbarclay commentedComment #3
johnbarclay commentedIn drupal usernames, spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores. So I don't see this as an issue.
If a need to pursue this comes up, a simple approach would be to map the "expected" unacceptable characters in user_validate_name() to acceptable ones, then run the resulting username through user_validate_name() to make sure the username was still valid. This presents one security problem where jane@doe and jane!doe in LDAP would both map to jane_doe, where _ is the replacement character.
The "," is the only character I can think of that come up such as cn=Doe\, Jane,ou=blah,... Please chime in with other common characters disallowed in drupal usernames and we can add a checkbox in the config form to have these converted automatically.
See also http://api.drupal.org/api/drupal/modules%21user%21user.module/function/u...
Comment #4
johnbarclay commentedComment #5
larowlanno update for > 12 months, no patches - closing