2008-08-21, 11:12 PM
The (do_)editprofile actions in modcp.php use this buggy code with a confusing comment... O.o
Shouldn't the modcp_can_manage_user() function be used instead?
Part 2 of the problem: even after changing the code to use that function, it's still impossible to edit admin profiles. Even when logged in as a super admin, you can't edit your own profile or the profile of any other admin.
I think this will fix it... in /inc/functions_modcp.php find:
Replace with:
// Current user is a super mod or is an administrator and the user we are editing is a super admin, cannot edit admins
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['cancp'] == 1 || (is_super_admin($user['uid']) && !is_super_admin($user['uid'])))
Shouldn't the modcp_can_manage_user() function be used instead?
Part 2 of the problem: even after changing the code to use that function, it's still impossible to edit admin profiles. Even when logged in as a super admin, you can't edit your own profile or the profile of any other admin.
I think this will fix it... in /inc/functions_modcp.php find:
else if($mybb->usergroup['issupermod'] == 1 && $user_permissions['cancp'] == 1 || (is_super_admin($uid) && !is_super_admin($mybb->user['uid'])))
Replace with:
if($user_permissions['cancp'] == 1 && ($mybb->usergroup['cancp'] != 1 || (is_super_admin($uid) && !is_super_admin($mybb->user['uid']))))