Make WordPress Core

Opened 21 years ago

Closed 21 years ago

#1825 closed defect (bug) (fixed)

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

Reported by: MichaelH Owned by: davidhouse
Priority: normal Milestone:
Component: Administration Version: 1.6
Severity: minor Keywords: role capabilities bg|has-patch bg|squashed
Cc: Focuses:

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 21 years ago.
admin-functions.php.patch​ (701 bytes ) - added by ringmaster 21 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 21 years ago.
Oops. Need to remove some leftovers.
show_user_role_in_profile.diff​ (659 bytes ) - added by MichaelH 21 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
21 years ago

  • Keywords bg|has-patch added

Covers both requirements.

#2 @davidhouse
21 years ago

  • Keywords bg|squashed added
  • Owner changed from anonymous to davidhouse
  • Status new → assigned

Accepting and tagging as per westi's suggestions.

#3 @MichaelH
21 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
21 years ago

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

#4 @ryan
21 years ago

  • Resolution → fixed
  • Status assigned → 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
21 years ago

Oops. Need to remove some leftovers.

#5 @ringmaster
21 years ago

  • Resolution fixed
  • Status closed → 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
21 years ago

  • Resolution → fixed
  • Status reopened → closed

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

#7 @MichaelH
21 years ago

  • Resolution fixed
  • Status closed → 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
21 years ago

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

#8 @ryan
21 years ago

I think Matt purposefully removed it.

#9 @davidhouse
21 years ago

  • Resolution → fixed
  • Status reopened → closed
Note: See TracTickets for help on using tickets.