Exemplo n.º 1
0
  @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::checkCentralAccess();
Html::header(__('Monitoring', 'monitoring'), $_SERVER["PHP_SELF"], "plugins", "monitoring", "servicedef");
$pmServicedef = new PluginMonitoringServicedef();
if (isset($_POST["add"])) {
    $pmServicedef->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $pmServicedef->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["delete"])) {
            $pmServicedef->delete($_POST);
            Html::back();
        }
    }
}
if (isset($_GET["id"])) {
    $pmServicedef->showForm($_GET["id"]);
} else {
    $pmServicedef->showForm(0);
}
Html::footer();
Exemplo n.º 2
0
                }
                $input['arguments'] = exportArrayToDB($a_arguments);
                $pMonitoringService->update($input);
            }
        } else {
            $pMonitoringServicedef = new PluginMonitoringServicedef();
            if ($_POST['plugin_monitoring_servicedefs_id'] == '0') {
                // Add the service
                $id = $_POST['id'];
                unset($_POST['id']);
                $_POST['plugin_monitoring_servicedefs_id'] = $pMonitoringServicedef->add($_POST);
                $_POST['id'] = $id;
            } else {
                $pMonitoringServicedef->getFromDB($_POST['plugin_monitoring_servicedefs_id']);
                if ($pMonitoringServicedef->fields['is_template'] == '0') {
                    $pMonitoringServicedef->update($_POST);
                }
            }
            if (isset($_POST['arg'])) {
                $_POST['arguments'] = exportArrayToDB($_POST['arg']);
            }
            if (isset($_POST['alias_commandservice'])) {
                $_POST['alias_command'] = $_POST['alias_commandservice'];
            }
            $pMonitoringService->update($_POST);
        }
        glpi_header($_SERVER['HTTP_REFERER']);
    }
}
if (isset($_GET["id"])) {
    $pMonitoringService->showForm($_GET["id"]);