Opened 15 years ago
Closed 15 years ago
#12387 closed defect (bug) (fixed)
has_cap issue with Super Admins editing profile
Reported by: | miklb | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Administration | Keywords: | needs-patch |
Focuses: | multisite | Cc: |
Description
If a Super Admin is in the backend of a site they are not a user on, and tries to edit their own profile via Network->Users, you receive a Call to a member function has_cap() on a non-object wp-admin/includes/user.php on line 80
This bug seems to date back in WPMU to at least 2.8.6 in my testing.
I would expect a Super Admin to be able to edit their profile from anywhere, but if that's not the case, and they need to be a user of of the site they are in, then some more graceful error message I think would be appropriate.
Attachments (1)
Change History (10)
#6
@
15 years ago
So to confirm, that is the desired behavior? A Super Admin can't edit their own profile while in the backend of a site they aren't a member of? This fix shows a "You can’t give users that role." error, which still seems odd. If they are a Super Admin, editing their own profile, or any user for that matter why would they get that error?
#7
@
15 years ago
- Keywords multisite needs-patch added; has-patch needs-testing removed
- Owner set to nacin
- Status changed from new to assigned
L80:
$wp_roles->role_objects[$new_role]->has_cap()
would also fail on PHP4 as object chaining is not supported.My MS environment is down right now, But i've attached a (untested) patch, If someone could test this under PHP4 and the affected environment mentioned, that'd be appreciated