0) { foreach (array_keys($settings_graphs) as $setting) { if (isset($_POST[$setting])) { db_execute("replace into settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"]. ",'$setting', '" . $_POST[$setting] . "')"); } } } /* reset local settings cache so the user sees the new settings */ kill_session_var("sess_graph_config_array"); header ("Location: " . $_POST["referer"]); } /* -------------------------- Graph Settings Functions -------------------------- */ function settings() { global $colors, $tabs_graphs, $settings_graphs, $current_user, $graph_views, $current_user; /* you cannot have per-user graph settings if cacti's user management is not turned on */ if (read_config_option("global_auth") == "") { raise_message(6); display_output_messages(); return; } /* Find out whether this user has right here */ if($current_user["graph_settings"] == "") { print "YOU DO NOT HAVE RIGHTS TO CHANGE GRAPH SETTINGS"; include_once ("include/bottom_footer.php"); exit; } if (read_config_option("global_auth") == "on") { if ($current_user["graph_policy"] == "1") { $sql_where = "where user_auth_tree.user_id is null"; }elseif ($current_user["graph_policy"] == "2") { $sql_where = "where user_auth_tree.user_id is not null"; } $settings_graphs["default_tree_id"]["sql"] = "select graph_tree.id, graph_tree.name, user_auth_tree.user_id from graph_tree left join user_auth_tree on (graph_tree.id=user_auth_tree.tree_id and user_auth_tree.user_id=" . $_SESSION["sess_user_id"] . ") $sql_where order by graph_tree.name"; } print "