} for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) { if ($config['interfaces']['opt' . $i]['if'] === $ifn) { return true; } } return false; } if ($_GET['act'] === "del") { if (FALSE === ($cnid = array_search_ex($_GET['uuid'], $config['vinterfaces']['lagg'], "uuid"))) { header("Location: interfaces_lagg.php"); exit; } $lagg = $a_lagg[$cnid]; // Check if still in use. if (lagg_inuse($lagg['if'])) { $input_errors[] = gettext("This LAGG cannot be deleted because it is still being used as an interface."); } else { mwexec("/usr/local/sbin/rconf attribute remove 'ifconfig_{$lagg['if']}'"); unset($a_lagg[$cnid]); write_config(); touch($d_sysrebootreqd_path); header("Location: interfaces_lagg.php"); exit; } } include "fbegin.inc"; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="tabnavtbl">
foreach ($config['vlans']['vlan'] as $vlan) { if ($vlan['if'] == $a_laggs[$num]['laggif']) { return true; } } } return false; } if ($_GET['act'] == "del") { if (!isset($_GET['id'])) { $input_errors[] = gettext("Wrong parameters supplied"); } else { if (empty($a_laggs[$_GET['id']])) { $input_errors[] = gettext("Wrong index supplied"); } else { if (lagg_inuse($_GET['id'])) { $input_errors[] = gettext("This LAGG interface cannot be deleted because it is still being used."); } else { mwexec_bg("/sbin/ifconfig " . $a_laggs[$_GET['id']]['laggif'] . " destroy"); unset($a_laggs[$_GET['id']]); write_config(); header("Location: interfaces_lagg.php"); exit; } } } } $pgtitle = array(gettext("Interfaces"), gettext("LAGG")); $shortcut_section = "interfaces"; include "head.inc"; ?>
} } } return false; } if (!isset($config['laggs']['lagg'])) { $a_laggs = array(); } else { $a_laggs =& $config['laggs']['lagg']; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($a_laggs[$_POST['id']])) { $id = $_POST['id']; } if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (lagg_inuse($a_laggs[$id]['laggif'])) { $input_errors[] = gettext("This LAGG interface cannot be deleted because it is still being used."); } else { mwexec_bg("/sbin/ifconfig " . escapeshellarg($a_laggs[$id]['laggif']) . " destroy"); unset($a_laggs[$id]); write_config(); header("Location: interfaces_lagg.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_laggs); $main_buttons = array(array('href' => 'interfaces_lagg_edit.php', 'label' => gettext('Add'))); ?>