delete(); $success = "Member Deleted"; } } if($_GET['request'] == "delete" && $_GET['section'] == 'general') { $serviceGroup->delete(); $success = "Service Group Deleted."; unset($serviceGroup); unset($_GET['id']); } } if(isset($_POST['request'])) { if($_POST['request'] == 'add_servicegroup') { // Check for pre-existing contact with same name if($lilac->servicegroup_exists($_POST['servicegroup_name'])) { $error = "A service group with that name already exists!"; } else { // Field Error Checking if($_POST['servicegroup_name'] == '' || $_POST['alias'] == '') { $error = "Fields shown are required and cannot be left blank."; } else { // All is well for error checking, add the servicegroup into the db. $serviceGroup = new NagiosServiceGroup(); $serviceGroup->setName($_POST['servicegroup_name']); $serviceGroup->setAlias($_POST['alias']); $serviceGroup->save(); header("Location: servicegroups.php?id=" . $serviceGroup->getId()); die(); } } } else if($_POST['request'] == 'modify_servicegroup') { if($_POST['servicegroup_name'] != $serviceGroup->getName() && $lilac->servicegroup_exists($_POST['servicegroup_name'])) { $error = "A service group with that name already exists!"; } else { // Error check! // Field Error Checking if($_POST['servicegroup_name'] == '' || $_POST['alias'] == '') { $addError = 1; $error = "Fields shown are required and cannot be left blank."; } else { // All is well for error checking, modify the group. $serviceGroup->setName($_POST['servicegroup_name']); $serviceGroup->setAlias($_POST['alias']); $serviceGroup->save(); $success = "Service group modified."; unset($_GET['edit']); } } $_GET['section'] = "general"; } else if($_POST['request'] == 'modify_servicegroup_extended') { $serviceGroup->setNotes($_POST['notes']); $serviceGroup->setNotesUrl($_POST['notes_url']); $serviceGroup->setActionUrl($_POST['action_url']); $serviceGroup->save(); $success = "Service group modified."; unset($_GET['edit']); } else if($_POST['request'] == 'add_contactgroup_command') { if($lilac->hostgroup_has_contactgroup($_GET['id'], $serviceGroup['contactgroup_add']['contactgroup_id'])) { $error = "That contact group already exists in that list!"; unset($serviceGroup); } else { $lilac->add_hostgroup_contactgroup($_GET['id'], $serviceGroup['contactgroup_add']['contactgroup_id']); $success = "New Host Group Contact Group Link added."; unset($serviceGroup); } } } // Get list of service groups $lilac->get_servicegroup_list($servicegroups_list); $numOfServiceGroups = count($servicegroups_list); print_header("Service Group Editor"); ?> 'General', 'extended' => 'Extended Information', 'members' => 'Members' ); // PLACEHOLDER TO PUT CONTACT GROUP INFO print_window_header("Group Info for " . $serviceGroup->getName(), "100%"); print_subnav($subnav, $_GET['section'], "section", $_SERVER['PHP_SELF'] . "?id=" . $_GET['id']); if($_GET['section'] == 'general') { ?>
Service Group Name: getName();?> Description: getAlias();?> [ Edit ] |
getNotes() != '') {
?>
Notes: getNotes();?> getNotesUrl() != '') { ?> Notes URL: getNotesUrl();?> getActionUrl() != '') { ?> Action URL: getActionUrl();?> [ Edit ] |
|
Group Name | Description |
getName();?> | getAlias();?> |