delete(); $success = "Command Deleted"; unset($command); } } if(isset($_POST['request'])) { // Load Up The Session Data if($_POST['request'] == 'add_command') { // Error check for required fields if(!isset($_POST['command_manage']['command_name'])) { $error = "You must provide a command name."; $_GET['command_add'] = 1; } else { // Check for pre-existing command with same name if($lilac->command_exists($_POST['command_manage']['command_name'])) { $error = "A command with that name already exists!"; $_GET['command_add'] = 1; } else { // All is well for error checking, add the command into the db. $lilac->add_command($_POST['command_manage']); // Remove session data unset($command); $success = "Command added."; } } } else if($_POST['request'] == 'modify_command') { $c = new Criteria(); $c->add(NagiosCommandPeer::NAME, $_POST['command_manage']['command_name']); $c->setIgnoreCase(true); $c->add(NagiosCommandPeer::ID, $command->getId(), "!="); $duplicate = NagiosCommandPeer::doSelectOne($c); if($duplicate && $command->getId() != $duplicate->getId()) { $error = "A command with that name already exists!"; } else { // All is well for error checking, modify the command. $command->updateFromArray($_POST['command_manage']); $command->save(); $success = "Command modified."; unset($command); } } } // Get list of commands $lilac->return_command_list($command_list); $numOfCommands = count($command_list); print_header("Nagios Command Editor"); ?>
Command Name:

element_desc("command_name", "nagios_commands_desc"); ?>

Command Line:

element_desc("command_line", "nagios_commands_desc"); ?>

Command Description:

element_desc("command_desc", "nagios_commands_desc"); ?>


Delete  Cancel  Cancel

 Add A New Command

Command Name Command Description
 getName();?>  getDescription();?>

No Commands Exist