示例#1
0
        if ($output) {
            $flashes['danger'][] = $output;
        } else {
            $flashes['success'][] = 'File successfully imported';
        }
        header('Location: index.php');
    }
}
if (isset($_GET['remove'])) {
    $rule = buildRuleFromQuery($_GET);
    $iptables->remove($rule, $_GET['table'], $_GET['chain']);
}
if (isset($_GET['edit'])) {
    $editDialogDisplayed = TRUE;
    $rule = buildRuleFromQuery($_GET);
    $editDialogAction .= '?edit&' . buildQueryFromRule($rule, $_GET['table'], $_GET['chain']);
    if (isset($_POST['submit'])) {
        $iptables->remove($rule, $_GET['table'], $_GET['chain']);
        $newRule = buildRuleFromQuery($_POST);
        $iptables->add($newRule, $_POST['table'], $_POST['chain']);
    }
}
if (isset($_GET['add'])) {
    $editDialogDisplayed = TRUE;
    $editDialogAction .= '?add';
    if (isset($_POST['submit'])) {
        $rule = buildRuleFromQuery($_POST);
        $iptables->add($rule, $_POST['table'], $_POST['chain']);
    }
}
include __DIR__ . '/template.phtml';