1 --- cacti-0.8.7g/graph_view.php 2010-07-09 18:33:46.000000000 -0400
2 +++ cacti-0.8.7g-patched/graph_view.php 2010-07-27 21:30:31.000000000 -0400
7 - /* the user select a bunch of graphs of the 'list' view and wants them dsplayed here */
8 + /* the user select a bunch of graphs of the 'list' view and wants them displayed here */
9 if (isset($_REQUEST["style"])) {
10 if (get_request_var_request("style") == "selective") {
13 $sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
15 $hosts = db_fetch_assoc("SELECT DISTINCT host.id, host.description as name
16 - FROM (graph_templates_graph,graph_local)
17 - LEFT JOIN host ON (host.id=graph_local.host_id)
19 + LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
20 + LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
21 LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
22 LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
23 WHERE graph_templates_graph.local_graph_id=graph_local.id
26 if (read_config_option("auth_method") != 0) {
27 $graph_templates = db_fetch_assoc("SELECT DISTINCT graph_templates.*
28 - FROM (graph_templates_graph,graph_local)
29 - LEFT JOIN host ON (host.id=graph_local.host_id)
31 + LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
32 + LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
33 LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
34 LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
35 WHERE graph_templates_graph.local_graph_id=graph_local.id
38 /* if any of the settings changed, reset the page number */
40 - $changed += check_changed("host_id", "sess_graphs_view_list_host");
41 - $changed += check_changed("rows", "sess_graphs_view_list_rows");
42 - $changed += check_changed("graph_template_id", "sess_graphs_view_list_graph_template");
43 - $changed += check_changed("filter", "sess_graphs_view_list_filter");
44 + $changed += check_changed("host_id", "sess_graph_view_list_host");
45 + $changed += check_changed("rows", "sess_graph_view_list_rows");
46 + $changed += check_changed("graph_template_id", "sess_graph_view_list_graph_template");
47 + $changed += check_changed("filter", "sess_graph_view_list_filter");
48 if ($changed) $_REQUEST["page"] = 1;
53 <tr bgcolor="#<?php print $colors["panel"];?>">
55 - <form style="margin:0px;padding:0px;" name="form_graph_list" method="POST" onSubmit='form_graph(document.chk,document.form_graph_list)' action="graph_view.php">
56 + <form style="margin:0px;padding:0px;" name="form_graph_list" method="POST" onSubmit='form_graph(document.chk,document.form_graph_list)'>
57 <table width="100%" cellpadding="0" cellspacing="0">
59 <td nowrap style='white-space: nowrap;' width="40">
61 $sql_where = get_graph_permissions_sql($current_user["policy_graphs"], $current_user["policy_hosts"], $current_user["policy_graph_templates"]);
63 $hosts = db_fetch_assoc("SELECT DISTINCT host.id, host.description as name
64 - FROM (graph_templates_graph,graph_local)
65 - LEFT JOIN host ON (host.id=graph_local.host_id)
67 + LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
68 + LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
69 LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
70 LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
71 WHERE graph_templates_graph.local_graph_id=graph_local.id
74 if (read_config_option("auth_method") != 0) {
75 $graph_templates = db_fetch_assoc("SELECT DISTINCT graph_templates.*
76 - FROM (graph_templates_graph,graph_local)
77 - LEFT JOIN host ON (host.id=graph_local.host_id)
79 + LEFT JOIN graph_local ON ( host.id = graph_local.host_id )
80 + LEFT JOIN graph_templates_graph ON ( graph_templates_graph.local_graph_id = graph_local.id )
81 LEFT JOIN graph_templates ON (graph_templates.id=graph_local.graph_template_id)
82 LEFT JOIN user_auth_perms ON ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . ") OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=" . $_SESSION["sess_user_id"] . "))
83 WHERE graph_templates_graph.local_graph_id=graph_local.id
86 html_start_box("", "100%", $colors["header"], "1", "center", "");
88 - html_header_checkbox(array("Graph Title", "Graph Size"));
89 + html_header_checkbox(array("Graph Title", "Graph Size"), false);
92 if (sizeof($graphs)) {
93 foreach ($graphs as $graph) {
94 form_alternate_row_color($colors["alternate"], $colors["light"], $i, 'line' . $graph["local_graph_id"]); $i++;
95 - form_selectable_cell("<strong><a href='" . htmlspecialchars("graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all") . "'>" . htmlspecialchars($graph["title_cache"]) . "</a><strong>", $graph["local_graph_id"]);
96 + form_selectable_cell("<strong><a href='" . htmlspecialchars("graph.php?local_graph_id=" . $graph["local_graph_id"] . "&rra_id=all") . "'>" . htmlspecialchars($graph["title_cache"]) . "</a></strong>", $graph["local_graph_id"]);
97 form_selectable_cell($graph["height"] . "x" . $graph["width"], $graph["local_graph_id"]);
98 form_checkbox_cell($graph["title_cache"], $graph["local_graph_id"]);
101 strDel = strDel.substring(0,strDel.length - 1);
102 strURL = '&graph_add=' + strAdd + '&graph_remove=' + strDel;
103 return strNavURL + strURL;
109 function url_go(strURL) {
110 document.location = strURL;