diff --git a/graph_view.php b/graph_view.php
index 9d61ac4f56..f1932820ca 100644
--- a/graph_view.php
+++ b/graph_view.php
@@ -601,6 +601,21 @@ function get_matching_nodes() {
$rows = get_request_var('rows');
}
+ /* check to see if site_id and location are mismatched */
+ if (get_request_var('site_id') >= 0) {
+ if (get_request_var('location') != '0' && get_request_var('location') != '-1') {
+ $exists = db_fetch_cell_prepared('SELECT COUNT(*)
+ FROM host
+ WHERE site_id = ?
+ AND location = ?',
+ array(get_request_var('site_id'), get_request_var('location')));
+
+ if (!$exists) {
+ set_request_var('location', '-1');
+ }
+ }
+ }
+
$graph_list = array();
/* save selected graphs into url */
@@ -673,13 +688,13 @@ function get_matching_nodes() {
= 0) {
$loc_where = 'WHERE site_id = ' . db_qstr(get_request_var('site_id'));
} else {
$loc_where = '';
}
-
+
html_location_filter(get_request_var('location'), 'applyFilter', $loc_where);
?>
@@ -690,7 +705,7 @@ function get_matching_nodes() {
0 ? ',':'') + graphID;
}
});
-
+
strURL = '&demon=1&graph_list=&graph_add=' + strAdd + '&graph_remove=' + strDel;
-
+
return strNavURL + strURL;
} else {
return strNavURL;
}
}
-
+
function graphChecked(graph_id) {
for(var i = 0; i < graph_list_array.length; i++) {
if (graph_list_array[i] == graph_id) {
return true;
}
}
-
+
return false;
}
-
+
function addReport() {
$('#addGraphs').dialog({
title: '',
@@ -1048,16 +1063,16 @@ function addReport() {
}
});
$('#graph_list').val(graphList);
-
+
$(this).dialog('close');
-
+
strURL = 'graph_view.php?action=ajax_reports' +
'&header=false' +
'&report_id=' + $('#report_id').val() +
'×pan=' + $('#timespan').val() +
'&align=' + $('#align').val() +
'&graph_list=' + $('#graph_list').val();
-
+
loadUrl({url:strURL});
}
}
|