Ticket #17924: 17924.07.patch
File 17924.07.patch, 1.5 KB (added by , 9 years ago) |
---|
-
wp-admin/network/site-users.php
128 128 if ( isset( $_REQUEST['users'] ) ) { 129 129 $userids = $_REQUEST['users']; 130 130 $update = 'promote'; 131 $blog_roles = array_keys( $editable_roles ); 131 132 foreach ( $userids as $user_id ) { 132 133 $user_id = (int) $user_id; 133 134 … … 136 137 wp_die( __( 'Cheatin’ uh?' ), 403 ); 137 138 138 139 $user = get_userdata( $user_id ); 139 $user->set_role( $_REQUEST['new_role'] ); 140 141 // Remove any blog roles for this user 142 foreach ( $blog_roles as $blog_role ) { 143 if ( $user->has_cap( $blog_role ) ) { 144 $user->remove_role( $blog_role ); 145 } 146 } 147 148 // Add back the role being bulk-set 149 $user->add_role( $_REQUEST['new_role'] ); 140 150 } 141 151 } else { 142 152 $update = 'err_promote'; -
wp-admin/users.php
114 114 115 115 $userids = $_REQUEST['users']; 116 116 $update = 'promote'; 117 $blog_roles = array_keys( $editable_roles ); 117 118 foreach ( $userids as $id ) { 118 119 $id = (int) $id; 119 120 … … 131 132 wp_die( __( 'Cheatin’ uh?' ), 403 ); 132 133 133 134 $user = get_userdata( $id ); 134 $user->set_role($_REQUEST['new_role']); 135 136 // Remove any blog roles for this user 137 foreach ( $blog_roles as $blog_role ) { 138 if ( $user->has_cap( $blog_role ) ) { 139 $user->remove_role( $blog_role ); 140 } 141 } 142 143 // Add back the role being bulk-set 144 $user->add_role( $_REQUEST['new_role'] ); 135 145 } 136 146