Пример #1
0
}
// Data preparation
if (!isset($_GET['section'])) {
    $_GET['section'] = 'general';
}
// If we're going to modify dependency data
if (isset($_GET['id'])) {
    $dependency = NagiosDependencyPeer::retrieveByPK($_GET['id']);
    if (!$dependency) {
        header("Location: welcome.php");
    }
}
// Action Handlers
if (isset($_GET['request'])) {
    if ($_GET['request'] == "delete" && $_GET['section'] == "targets") {
        $target = NagiosDependencyTargetPeer::retrieveByPK($_GET['target_id']);
        if (!$target) {
            $error = "That target was not found.";
        } else {
            if ($target->getNagiosDependency()->getId() != $dependency->getId()) {
                $error = "That target does not belong to this dependency.";
            } else {
                // Okay, let's delete.
                $target->delete();
                $success = "Target deleted.";
            }
        }
    }
}
if (isset($_POST['request'])) {
    if ($_POST['request'] == 'dependency_modify_general') {