Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If a user doesn't have the right to "change own username" he's also not allowed to change his password:
You are not allowed to change this username.
This issue seems to be only in the newest cvs snapshot, not in 4.7.0-beta2 nor in an older snapshot.
If the user is allowed to "change own username" an error appears though the changes are saved.
warning: array_filter() [function.array-filter]: The first argument should be an array in /usr/local/apache2/htdocs/portal/modules/user.module on line 1247.
I'm using PHP 5.1.1.
Comment | File | Size | Author |
---|---|---|---|
#8 | user_submit_0.patch | 382 bytes | chx |
#4 | user_name.patch | 514 bytes | chx |
Comments
Comment #1
Cvbge CreditAttribution: Cvbge commentedConfirmed, not a PHP 5.x issue.
Critical because users are left with auto-generated passwords which are ugly.
Comment #2
jakeg CreditAttribution: jakeg commentedcvbge and myself confirmd this bug. setting priority to critical.
Comment #3
Cvbge CreditAttribution: Cvbge commentedIntroduced by 'change own username' patch:
user_edit_form() does not add 'name' field if user does not have permission.
Then in user_edit_validate() if user does not have permission we check
elseif $edit['name'] != $user->name
while the left part is not set.I think the correct solution would be to drop the elseif completly - if user does not have the permission, the field won't be set.
Comment #4
chx CreditAttribution: chx commentedAye and if the name is not set, then $form_values['name'] won't be set either. Wonders of form API. Indeed that elseif is not needed.
Comment #5
chx CreditAttribution: chx commentedComment #6
Dries CreditAttribution: Dries commentedCommitted to HEAD. Thanks.
Comment #7
darius CreditAttribution: darius commentedOne more thing to change in there:
warning: array_filter(): The first argument should be an array in /home/tinklas/public_html/cs/modules/user.module on line 1244.
The error occurs in function
_user_edit_submit($uid, &$edit)
, line:$edit['roles'] = array_filter($edit['roles']);
. If the user is not an admin,$edit['roles'])
is NULL.Darius
Comment #8
chx CreditAttribution: chx commentedComment #9
chx CreditAttribution: chx commentedComment #10
Dries CreditAttribution: Dries commentedCommitted to HEAD.
Comment #11
Dries CreditAttribution: Dries commentedComment #12
matias CreditAttribution: matias commentedI think this isn't fixed yet
I can duplicate this error in a fresh CVS install.
On line 1210 of user.module
If the user is not allowed to "change own username" $edit['name'] is not defined the "You are not allowed to change this username." error appears and the changes are not saved.
Comment #13
matias CreditAttribution: matias commentedSorry, I was working with an old version of user.module