id && !$wp_roles->role_objects[$_POST['new_role']]->has_cap('edit_users')) { $update = 'err_admin_role'; continue; } $user = new WP_User($id); $user->set_role($_POST['new_role']); } header('Location: users.php?update=' . $update); break; case 'dodelete': check_admin_referer(); if ( empty($_POST['users']) ) { header('Location: users.php'); } if ( !current_user_can('edit_users') ) die(__('You can’t delete users.')); $userids = $_POST['users']; $update = 'del'; foreach ($userids as $id) { if($id == $current_user->id) { $update = 'err_admin_del'; continue; } switch($_POST['delete_option']) { case 'delete': wp_delete_user($id); break; case 'reassign': wp_delete_user($id, $_POST['reassign_user']); break; } } header('Location: users.php?update=' . $update); break; case 'delete': check_admin_referer(); if (empty($_POST['users'])) { header('Location: users.php'); } if ( !current_user_can('edit_users') ) $error = new WP_Error('edit_users', __('You can’t delete users.')); $userids = $_POST['users']; include ('admin-header.php'); ?>
get_col("SELECT ID FROM $wpdb->users;"); foreach($userids as $userid) { $tmp_user = new WP_User($userid); $roles = $tmp_user->roles; $role = array_shift($roles); $roleclasses[$role][$tmp_user->user_login] = $tmp_user; } ?>