diff --git a/includes/html/modal/delete_service_template.inc.php b/includes/html/modal/delete_service_template.inc.php new file mode 100644 index 0000000000..5f541bd8f2 --- /dev/null +++ b/includes/html/modal/delete_service_template.inc.php @@ -0,0 +1,78 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if (Auth::user()->hasGlobalAdmin()) { + ?> + +
+ + + diff --git a/includes/html/modal/new_service_template.inc.php b/includes/html/modal/new_service_template.inc.php new file mode 100644 index 0000000000..967ef3a40c --- /dev/null +++ b/includes/html/modal/new_service_template.inc.php @@ -0,0 +1,169 @@ + + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. + */ + +if (Auth::user()->hasGlobalAdmin()) { + // Build the types list. + $dir = \LibreNMS\Config::get('nagios_plugins'); + if (file_exists($dir) && is_dir($dir)) { + $files = scandir($dir); + $dir .= DIRECTORY_SEPARATOR; + foreach ($files as $file) { + if (is_executable($dir.$file) && is_file($dir.$file) && strstr($file, 'check_')) { + list(,$check_name) = explode('_', $file, 2); + $stype .= ""; + } + } + } + ?> + + + + + hasGlobalAdmin()) { + include 'includes/html/error-no-perm.inc.php'; +} else { + if ($vars['addsrvtp']) { + if (Auth::user()->hasGlobalAdmin()) { + $updated = '1'; + + $service_template_id = add_service_template($vars['device_group'], $vars['type'], $vars['descr'], $vars['params'], 0); + if ($service_template_id) { + $message .= $message_break.'Service Template added ('.$service_template_id.')!'; + $message_break .= '| '; + echo ' | Service | '; + echo 'Last Changed | '; + echo 'Description | '; + echo 'Message | '; + echo ''; + echo ''; + } + + $header = false; + + echo ' |
|---|---|---|---|---|---|
| '; + echo ' | ' . nl2br(display($service_template['service_template_type'])) . ' | '; + echo '' . formatUptime(time() - $service_template['service_template_changed']) . ' | '; + echo '' . nl2br(display($service_template['service_template_desc'])) . ' | '; + echo '' . nl2br(display($service_template['service_template_message'])) . ' | '; + + if (Auth::user()->hasGlobalAdmin()) { + echo "+ + + | "; + } + echo '