From 9aa60c4066a5b2bb14ec6e5779c11ac6f3a2d806 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 30 Dec 2011 23:13:48 +0000 Subject: [PATCH] Only allow _multisite_ super admins to demote themselves on a site. props linuxologos, see #19684 for trunk. git-svn-id: http://svn.automattic.com/wordpress/trunk@19640 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/users.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/users.php b/wp-admin/users.php index 2cfbe6374..a7ce5edaa 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -100,10 +100,11 @@ case 'promote': if ( ! current_user_can('promote_user', $id) ) wp_die(__('You can’t edit that user.')); - // The new role of the current user must also have the promote_users cap or be a super admin - if ( $id == $current_user->ID && ! is_super_admin() && ! $wp_roles->role_objects[ $_REQUEST['new_role'] ]->has_cap('promote_users') ) { - $update = 'err_admin_role'; - continue; + // The new role of the current user must also have the promote_users cap or be a multisite super admin + if ( $id == $current_user->ID && ! $wp_roles->role_objects[ $_REQUEST['new_role'] ]->has_cap('promote_users') + && ! ( is_multisite() && is_super_admin() ) ) { + $update = 'err_admin_role'; + continue; } // If the user doesn't already belong to the blog, bail.