Esempio n. 1
0
  @co-author 
  @comment   
  @copyright Copyright (c) 2011-2013 Plugin Monitoring for GLPI team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      https://forge.indepnet.net/projects/monitoring/
  @since     2011

  ------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
PluginMonitoringProfile::checkRight("component", "w");
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "components");
$pMonitoringComponent = new PluginMonitoringComponent();
if (isset($_POST["copy"])) {
    $pMonitoringComponent->showForm(0, array(), $_POST);
    Html::footer();
    exit;
} else {
    if (isset($_POST["add"])) {
        if (isset($_POST['arg'])) {
            $_POST['arguments'] = exportArrayToDB($_POST['arg']);
        }
        if (empty($_POST['name']) or empty($_POST['plugin_monitoring_checks_id']) or empty($_POST['plugin_monitoring_commands_id']) or empty($_POST['calendars_id'])) {
            $_SESSION['plugin_monitoring_components'] = $_POST;
            Session::addMessageAfterRedirect("<font class='red'>" . __('Fields with asterisk are required', 'monitoring') . "</font>");
            Html::back();
        }
        if ($_POST['graph_template'] != '') {
            $a_perfnames = array();
            $a_perfnames = PluginMonitoringServicegraph::getperfdataNames($_POST['graph_template']);
  @comment
  @copyright Copyright (c) 2011-2014 Plugin Monitoring for GLPI team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      https://forge.indepnet.net/projects/monitoring/
  @since     2011

  ------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkRight("plugin_monitoring_component", READ);
Html::header(__('Monitoring - component', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "PluginMonitoringDashboard", "component");
$pMonitoringComponent = new PluginMonitoringComponent();
//echo "<pre>";print_r($_POST);exit;
if (isset($_POST["copy"])) {
    $pMonitoringComponent->showForm(0, array(), $_POST);
    Html::footer();
    exit;
} else {
    if (isset($_POST["add"])) {
        if (isset($_POST['arg'])) {
            $_POST['arguments'] = exportArrayToDB($_POST['arg']);
        }
        if (empty($_POST['name']) or empty($_POST['plugin_monitoring_checks_id']) or empty($_POST['plugin_monitoring_commands_id']) or empty($_POST['calendars_id'])) {
            $_SESSION['plugin_monitoring_components'] = $_POST;
            Session::addMessageAfterRedirect("<font class='red'>" . __('Fields with asterisk are required', 'monitoring') . "</font>");
            Html::back();
        }
        if ($_POST['graph_template'] != 0) {
            $a_perfnames = array();
            $a_perfnames = PluginMonitoringServicegraph::getperfdataNames($_POST['graph_template']);