/* modify for multi user start */ if (isset($_REQUEST['id'])) { if (!check_thold($_REQUEST['id'])) { access_denied(); } } /* modify for multi user start */ if (!isset($_REQUEST['action'])) { $_REQUEST['action'] = ''; } if (substr_count($_SERVER["HTTP_REFERER"], "graph_view.php") || substr_count($_SERVER["HTTP_REFERER"], "graph.php")) { $_SESSION["graph_return"] = $_SERVER["HTTP_REFERER"]; } switch ($_REQUEST['action']) { case 'save': save_thold(); if (isset($_SESSION["graph_return"])) { $return_to = $_SESSION["graph_return"]; unset($_SESSION["graph_return"]); kill_session_var("graph_return"); header('Location: ' . $return_to); } else { include_once $config['include_path'] . '/top_header.php'; } break; case 'autocreate': $c = autocreate($hostid); if ($c == 0) { $_SESSION['thold_message'] = '<font size=-1>Either No Templates or Threshold(s) Already Exists - No thresholds were created.</font>'; } raise_message('thold_created');
if (isset_request_var('id')) { get_filter_request_var('id'); } switch (get_request_var('action')) { case 'ajax_hosts': //get_allowed_ajax_hosts(true, false, 'h.id IN (SELECT host_id FROM thold_data)'); get_allowed_ajax_hosts(true, false); break; case 'ajax_hosts_noany': get_allowed_ajax_hosts(false, false, 'h.id IN (SELECT host_id FROM thold_data)'); break; case 'add': thold_add(); break; case 'save': $id = save_thold(); if (isset($_SESSION['data_return'])) { $return_to = $_SESSION['data_return']; unset($_SESSION['data_return']); kill_session_var('data_return'); header('Location: ' . $return_to); } elseif ($id) { header('Location: thold.php?action=edit&header=false&id=' . $id); } else { header('Location: thold.php'); } break; case 'autocreate': $c = autocreate(get_filter_request_var('host_id')); if ($c == 0) { $_SESSION['thold_message'] = '<font size=-1>' . __('Either No Templates or Threshold(s) Already Exists - No thresholds were created.') . '</font>';