header("Location: hosts.php?id=" . $tempHost->getId()); die; } } } $add_template_list[] = array("host_template_id" => '', "template_name" => "None"); $lilac->get_host_template_list($template_list); if (count($template_list)) { foreach ($template_list as $tempTemplate) { $add_template_list[] = array('host_template_id' => $tempTemplate->getId(), 'template_name' => $tempTemplate->getName()); } } print_header("Add New Host"); $title = "Add A Top-Level Host"; if (isset($_GET['parent_id'])) { $tempHostInfo = NagiosHostPeer::retrieveByPK($_GET['parent_id']); if ($tempHostInfo) { $title = "Add A Host Under " . $tempHostInfo->getName(); } } print_window_header($title, "100%"); ?> <form name="host_add_form" method="post" action="add_host.php<?php if (isset($_GET['parent_id'])) { print "?parent_id=" . $_GET['parent_id']; } ?> "> <input type="hidden" name="request" value="add_host" /> <?php if (isset($_GET['parent_id']) && $_GET['parent_id'] != 0) {
* Provides interface to maintain host templates * */ include_once 'includes/config.inc'; if (isset($_GET['host_template_id'])) { $tempSource = NagiosHostTemplatePeer::retrieveByPK($_GET['host_template_id']); $link = "host_template.php"; $fieldName = "host_template_id"; if (!$tempSource) { header("Location: welcome.php"); } $type = "hosttemplate"; $title = "Host Template"; } else { if (isset($_GET['host_id'])) { $tempSource = NagiosHostPeer::retrieveByPK($_GET['host_id']); $fieldName = "host_id"; $link = "hosts.php"; if (!$tempSource) { header("Location: welcome.php"); } $type = "host"; $title = "Host"; } else { if (isset($_GET['service_template_id'])) { $tempSource = NagiosServiceTemplatePeer::retrieveByPK($_GET['service_template_id']); $fieldName = "service_template_id"; $link = "service_template.php"; if (!$tempSource) { header("Location: welcome.php"); }
function build_navbar($host_id, &$navbar) { global $path_config; global $sys_config; global $lilac; $tempID = $host_id; $tempNavBar = ''; while ($tempID != 0) { // If anything other than the network object $host = NagiosHostPeer::retrieveByPK($tempID); $tempNavBar = "<a href=\"hosts.php?id=" . $tempID . "\">" . $host->getName() . "</a> > " . $tempNavBar; $tempID = $host->getParentHost(); } $tempNavBar = $tempNavBar; $navbar = $tempNavBar; }
* */ include_once 'includes/config.inc'; if (isset($_GET['host_template_id'])) { $hostTemplate = NagiosHostTemplatePeer::retrieveByPK($_GET['host_template_id']); if (!$hostTemplate) { header("Location: welcome.php"); die; } else { $title = " for Host Template " . $hostTemplate->getName(); $sublink = "?host_template_id=" . $hostTemplate->getId(); $cancelLink = "host_template.php?id=" . $hostTemplate->getId() . "§ion=services"; } } else { if (isset($_GET['host_id'])) { $host = NagiosHostPeer::retrieveByPK($_GET['host_id']); if (!$host) { header("Location: welcome.php"); die; } else { $title = " for Host " . $host->getName(); $sublink = "?host_id=" . $host->getId(); $cancelLink = "hosts.php?id=" . $host->getId() . "§ion=services"; } } else { if (isset($_GET['hostgroup_id'])) { $hostgroup = NagiosHostgroupPeer::retrieveByPK($_GET['hostgroup_id']); if (!$hostgroup) { header("Location: welcome.php"); die; } else {