Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#1825 closed defect (bug) (fixed)

Display a User's Role in profile.php and user-edit.php

Reported by: michaelh's profile MichaelH Owned by: davidhouse's profile davidhouse
Milestone: Priority: normal
Severity: minor Version: 1.6
Component: Administration Keywords: role capabilities bg|has-patch bg|squashed
Focuses: 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 (4)

show_role_on_profile.diff (2.5 KB) - added by davidhouse 19 years ago.
admin-functions.php.patch (701 bytes) - added by ringmaster 19 years ago.
Apply this after davidhouse's patch to prevent a edit_users user from demoting himself.
admin-functions.php.2.patch (433 bytes) - added by ringmaster 19 years ago.
Oops. Need to remove some leftovers.
show_user_role_in_profile.diff (659 bytes) - added by MichaelH 19 years ago.
just David's change to profile.php to show users their current role

Download all attachments as: .zip

Change History (13)

#1 @davidhouse
19 years ago

  • Keywords bg|has-patch added

Covers both requirements.

#2 @davidhouse
19 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.

#3 @MichaelH
19 years ago

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
19 years ago

Apply this after davidhouse's patch to prevent a edit_users user from demoting himself.

#4 @ryan
19 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [2995]) Show Role in profile and user edit. Don't allow users with edit_users caps to demote themselves. Props: davidhouse, ringmaster. fixes #1825

@ringmaster
19 years ago

Oops. Need to remove some leftovers.

#5 @ringmaster
19 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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.

#6 @matt
19 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [3064]) Fixes #1825 again so people can't demote themselves

#7 @MichaelH
19 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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.

@MichaelH
19 years ago

just David's change to profile.php to show users their current role

#8 @ryan
19 years ago

I think Matt purposefully removed it.

#9 @davidhouse
19 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.