qstr(get_request_var_post($field_name)); db_execute("REPLACE INTO settings_graphs (user_id,name,value) VALUES (" . $_SESSION["sess_user_id"] . ",'$field_name', $value)"); } }elseif ((isset($field_array["items"])) && (is_array($field_array["items"]))) { while (list($sub_field_name, $sub_field_array) = each($field_array["items"])) { if (isset($_POST[$sub_field_name])) { $value = $cnn_id->qstr(get_request_var_post($sub_field_name)); db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'$sub_field_name', " . $value . ")"); } } }else if (isset($_POST[$field_name])) { $value = $cnn_id->qstr($_POST[$field_name]); db_execute("REPLACE INTO settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"] . ",'$field_name', " . $value . ")"); } } } raise_message(1); /* reset local settings cache so the user sees the new settings */ kill_session_var("sess_graph_config_array"); } /* -------------------------- Graph Settings Functions -------------------------- */ function settings() { global $tabs_graphs, $settings_graphs, $current_user, $graph_views, $current_user; $current_user = db_fetch_row("SELECT * FROM user_auth WHERE id=" . $_SESSION['sess_user_id']); /* you cannot have per-user graph settings if cacti's user management is not turned on */ if (read_config_option("auth_method") == 0) { raise_message(6); display_output_messages(); return; } /* Find out whether this user has right here */ if (!is_view_allowed('graph_settings')) { print "YOU DO NOT HAVE RIGHTS TO CHANGE GRAPH SETTINGS"; bottom_footer(); exit; } if (read_config_option("auth_method") != 0) { $settings_graphs["tree"]["default_tree_id"]["sql"] = get_graph_tree_array(true); } print "