Closed (fixed)
Project:
LDAP integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2009 at 11:39 UTC
Updated:
18 May 2012 at 21:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
miglius commentedIf you're using LDAP provisioning, then changing the drupal username should not break the drupal account, but will rename account in ldap as well as local drupal account.
Comment #2
roball commentedI do use LDAP provisioning. Unfortunately, the username change does dot work properly! At least when you login as an LDAP user that has the "administer users" permission, but NOT the "change own username" permission.
If you then change your own username from - let's say user1 to user2, Drupal says the change was successful. The LDAP server in fact has changed the username properly. However, Drupal's "users" table then has both usernames stored, but you will only be able to login again with the old username. The LDAP sync gets messed up, and you have lost all your Drupal roles, maybe other information as well.
In short, changing the (at least own) username makes lots of trouble - maybe due to some bugs of LDAP provisioning. Untile these bugs get fixed, I think it would be easier to just give an option to disallow username change at all.
Comment #3
miglius commentedIn that case you should have opened a ticket in the LDAP provisional issues :)
It wired though as user renaming works fine on my setup, new row is not created in the users table, but rather the existing one is altered. Also drupal roles are not affected by the rename. Do you use the latest version of ldap_provisioning?
Comment #4
roball commentedRenaming his own username also works fine on my environment when the user have granted the permissions administer ldap modules, choose roles for new accounts, create accounts, administer permissions and administer users.
However, when the user that renames his own username only have administer users from the above listed permissions, the problems arise. In that case, the authmap table's authname value did not get changed! After logging out, the user cannot login with the new username. The user table creates a new user with the new username, assigning a new uid. The old account with the original uid will be kept, but looses the roles.
And yes, I am using the latest dev versions of your modules.
Comment #5
rjmackay commentedI've just made a patch that does this - adds an option similar to that for the email field to disable or remove the username field from the edit form.
I don't want to allow changing username, even for users with 'administer users' permissions - since this breaks the mapping.
Patch attached.
Comment #6
cgmonroe commentedA variation of the code from #5 has now been committed. If you don't have provisioning set up, a novice admin may cause problems by changing a user name, so having a way to prevent this is nice.
Sigh, comment patched:
- not been committed
+ now been committed