Beispiel #1
0
     if (isset($a_gateway_item[$realid]['disabled'])) {
         unset($a_gateway_item[$realid]['disabled']);
     } else {
         $a_gateway_item[$realid]['disabled'] = true;
     }
     if (write_config("Gateways: enable/disable")) {
         mark_subsystem_dirty('staticroutes');
     }
     header("Location: system_gateways.php");
     exit;
 } elseif (!empty($pconfig['rule']) && isset($pconfig['act']) && $pconfig['act'] == "del_x") {
     // delete selected items
     $input_errors = array();
     if (is_array($pconfig['rule']) && count($pconfig['rule'])) {
         foreach ($pconfig['rule'] as $rulei) {
             if (!can_delete_gateway_item($rulei, $a_gateways, $input_errors)) {
                 break;
             }
         }
         if (count($input_errors) == 0) {
             $items_deleted = "";
             foreach ($_POST['rule'] as $rulei) {
                 delete_gateway_item($rulei, $a_gateways);
                 $items_deleted .= "{$rulei} ";
             }
             if (!empty($items_deleted)) {
                 write_config("Gateways: removed gateways {$items_deleted}");
                 mark_subsystem_dirty('staticroutes');
             }
             header("Location: system_gateways.php");
             exit;
Beispiel #2
0
unset($input_errors);
if ($_GET['act'] == "del") {
    if (can_delete_gateway_item($_GET['id'])) {
        $realid = $a_gateways[$_GET['id']]['attribute'];
        delete_gateway_item($_GET['id']);
        write_config("Gateways: removed gateway {$realid}");
        mark_subsystem_dirty('staticroutes');
        header("Location: system_gateways.php");
        exit;
    }
}
if (isset($_POST['del_x'])) {
    /* delete selected items */
    if (is_array($_POST['rule']) && count($_POST['rule'])) {
        foreach ($_POST['rule'] as $rulei) {
            if (!can_delete_gateway_item($rulei)) {
                break;
            }
        }
        if (!isset($input_errors)) {
            $items_deleted = "";
            foreach ($_POST['rule'] as $rulei) {
                delete_gateway_item($rulei);
                $items_deleted .= "{$rulei} ";
            }
            if (!empty($items_deleted)) {
                write_config("Gateways: removed gateways {$items_deleted}");
                mark_subsystem_dirty('staticroutes');
            }
            header("Location: system_gateways.php");
            exit;