</tr> <?php if (fs_is_admin()) { ?> <tr> <td class="config_cell" width="300"> <h3><?php fs_e('Excluded users'); ?> </h3> <?php fs_e("WordPress users selected here will not be counted in the statistics"); ?> <br/> <div class='scroll' id="exclude_users_placeholder" style='height: 200px'><?php echo fs_get_excluded_users_list(); ?> </div> </td> <td class="config_cell"> <h3><?php fs_e('Permissions'); ?> </h3> <?php fs_e("Select the minimum user role that can access FireStats (Only administrators can manage FireStats)"); ?> <br/> <?php $selected = fs_get_local_option('firestats_min_view_security_level', 3); $arr = array();
function fs_ajax_updateExcludedUser(&$response) { $user_id = $_POST['user_id']; $selected = $_POST['selected'] === 'true'; $list = fs_get_local_option('firestats_excluded_users'); if (empty($list)) { $excluded_users = array(); } else { $excluded_users = explode(",", $list); } if ($selected) { if (!in_array($user_id, $excluded_users)) { $excluded_users[] = $user_id; } } else { fs_array_remove($excluded_users, $user_id); } $list = implode(",", $excluded_users); $res = fs_save_excluded_users($list); if ($res == '') { $response['fields']['exclude_users_placeholder'] = addslashes(fs_get_excluded_users_list()); $response['message'] = fs_r('Excluded users list saved'); } else { ajax_error($response, $res); } }