$description)); $info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description; if ($result) { pandora_audit("Command management", "Create alert command " . $result, false, false, $info); } else { pandora_audit("Command management", "Fail try to create alert command", false, false, $info); } print_result_message ($result, __('Successfully created'), __('Could not be created')); } if ($update_command) { $id = (int) get_parameter ('id'); $alert = get_alert_command ($id); if ($alert['internal']) { pandora_audit("ACL Violation", "Trying to access Alert Management"); require ("general/noaccess.php"); exit; } $name = (string) get_parameter ('name'); $command = (string) get_parameter ('command'); $description = (string) get_parameter ('description'); $values = array (); $values['name'] = $name; $values['command'] = $command; $values['description'] = $description; $result = update_alert_command ($id, $values); $info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description; if ($result) { pandora_audit("Command management", "Create alert command " . $id, false, false, $info); } else { pandora_audit("Command management", "Fail to create alert command " . $id, false, false, $info); } print_result_message ($result, __('Successfully updated'), __('Could not be updated')); } if ($delete_command) { $id = (int) get_parameter ('id'); // Internal commands cannot be deleted if (get_alert_command_internal ($id)) { pandora_audit("ACL Violation", "Trying to access Alert Management"); require ("general/noaccess.php"); return; } $result = delete_alert_command ($id); if ($result) { pandora_audit("Command management", "Delete alert command " . $id); } else { pandora_audit("Command management", "Fail to delete alert command " . $id); } print_result_message ($result, __('Successfully deleted'), __('Could not be deleted')); } $table->width = '90%'; $table->data = array (); $table->head = array (); $table->head[0] = __('Name'); $table->head[1] = __('Description'); $table->head[2] = __('Delete'); $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->size = array (); $table->size[2] = '40px'; $table->align = array (); $table->align[2] = 'center'; $commands = get_db_all_rows_in_table ('talert_commands'); if ($commands === false) $commands = array (); foreach ($commands as $command) { $data = array (); if (! $command['internal']) $data[0] = ''. $command['name'].''; else $data[0] = $command['name']; $data[1] = $command['description']; $data[2] = ''; if (! $command['internal']) $data[2] = ''. print_image("images/cross.png", true) . ''; array_push ($table->data, $data); } print_table ($table); echo '
'; echo '
'; print_submit_button (__('Create'), 'create', false, 'class="sub next"'); print_input_hidden ('create_alert', 1); echo '
'; echo '
'; ?>