MyBB Community Forums

Full Version: [F] [Mod CP] impossible to edit admin profiles
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The (do_)editprofile actions in modcp.php use this buggy code with a confusing comment... O.o

// 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']))))
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.