コード例 #1
0
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $a_gifs[$num]['gifif']) {
            return true;
        }
    }
    return false;
}
if ($_GET['act'] == "del") {
    if (!isset($_GET['id'])) {
        $input_errors[] = gettext("Wrong parameters supplied");
    } else {
        if (empty($a_gifs[$_GET['id']])) {
            $input_errors[] = gettext("Wrong index supplied");
            /* check if still in use */
        } else {
            if (gif_inuse($_GET['id'])) {
                $input_errors[] = gettext("This gif TUNNEL cannot be deleted because it is still being used as an interface.");
            } else {
                mwexec("/sbin/ifconfig " . $a_gifs[$_GET['id']]['gifif'] . " destroy");
                unset($a_gifs[$_GET['id']]);
                write_config();
                header("Location: interfaces_gif.php");
                exit;
            }
        }
    }
}
$pgtitle = array(gettext("Interfaces"), gettext("GIFs"));
$shortcut_section = "interfaces";
include "head.inc";
if ($input_errors) {
コード例 #2
0
ファイル: interfaces_gif.php プロジェクト: 8191/opnsense-core
            return true;
        }
    }
    return false;
}
if (!isset($config['gifs']['gif']) || !is_array($config['gifs']['gif'])) {
    $a_gifs = array();
} else {
    $a_gifs =& $config['gifs']['gif'];
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (!empty($a_gifs[$_POST['id']])) {
        $id = $_POST['id'];
    }
    if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) {
        if (gif_inuse($a_gifs[$id]['gifif'])) {
            $input_errors[] = gettext("This gif TUNNEL cannot be deleted because it is still being used as an interface.");
        } else {
            mwexec("/sbin/ifconfig " . escapeshellarg($a_gifs[$id]['gifif']) . " destroy");
            unset($a_gifs[$id]);
            write_config();
            header("Location: interfaces_gif.php");
            exit;
        }
    }
}
include "head.inc";
legacy_html_escape_form_data($a_gifs);
$main_buttons = array(array('href' => 'interfaces_gif_edit.php', 'label' => gettext('Add')));
?>