Ticket #1825 (closed defect (bug): fixed)
Display a User's Role in profile.php and user-edit.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 1.6 |
| Severity: | minor | Keywords: | role capabilities bg|has-patch bg|squashed |
| Cc: |
Description
The Users->Your Profile screen should display that user's current Role.
Actually, it's more important to show the user's Role in Users->Authors&Users; Edit a specific user (user-edit.php).
Attachments
Change History
comment:2
davidhouse — 6 years ago
- Keywords bg|squashed added
- Owner changed from anonymous to davidhouse
- Status changed from new to assigned
Accepting and tagging as per westi's suggestions.
With the patch installed, you can change a User's Role in user-edit.php, but you are allowed to "demote" yourself from being an administrator. As mentioned in Ticket 1645, the User should not be able to subtract edit_users capability from themselves.
To promote a user to administrator (that should kill ringmaster P) using phpMyAdmin, change wp_metauser for the user_id:
wp_capabilites to: a:1:{s:13:"administrator";b:1;} and wp_user_level to: 10
davidhouse: your patch does more than I asked for! Thanks.
ringmaster — 6 years ago
-
attachment
admin-functions.php.patch
added
Apply this after davidhouse's patch to prevent a edit_users user from demoting himself.
- Status changed from assigned to closed
- Resolution set to fixed
ringmaster — 6 years ago
-
attachment
admin-functions.php.2.patch
added
Oops. Need to remove some leftovers.
comment:5
ringmaster — 6 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
Some code got left in that shouldn't have. My fault.
Applying the last patch will remove code from admin-functions.php that will ensure that the user can't remove the edit-users capability from himself.
- Status changed from reopened to closed
- Resolution set to fixed
- Status changed from closed to reopened
- Resolution fixed deleted
Reopening because David's patch (show_role_on_profile.diff) for profile.php to show the User their current Role is no longer in the code.
-
attachment
show_user_role_in_profile.diff
added
just David's change to profile.php to show users their current role
