{ global $config, $g; $iflist = get_configured_interface_list(false, true); if (!is_array($config['ppps']['ppp'])) { return false; } foreach ($iflist as $if) { if ($config['interfaces'][$if]['if'] == $config['ppps']['ppp'][$num]['if']) { return true; } } return false; } if ($_GET['act'] == "del") { /* check if still in use */ if (ppp_inuse($_GET['id'])) { $input_errors[] = gettext("This point-to-point link cannot be deleted because it is still being used as an interface."); } elseif (is_array($config['ppps']['ppp']) && is_array($config['ppps']['ppp'][$_GET['id']])) { unset($config['ppps']['ppp'][$_GET['id']]['pppoe-reset-type']); handle_pppoe_reset($config['ppps']['ppp'][$_GET['id']]); unset($config['ppps']['ppp'][$_GET['id']]); write_config(); header("Location: interfaces_ppps.php"); exit; } } if (!is_array($config['ppps']['ppp'])) { $config['ppps']['ppp'] = array(); } $a_ppps = $config['ppps']['ppp']; $pgtitle = array(gettext("Interfaces"), gettext("PPPs"));
} } } return false; } if (!isset($config['ppps']['ppp']) || !is_array($config['ppps']['ppp'])) { $a_ppps = array(); } else { $a_ppps =& $config['ppps']['ppp']; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($a_ppps[$_POST['id']])) { $id = $_POST['id']; } if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (ppp_inuse($a_ppps[$id]['if'])) { $input_errors[] = gettext("This point-to-point link cannot be deleted because it is still being used as an interface."); } else { unset($a_ppps[$id]['pppoe-reset-type']); handle_pppoe_reset($a_ppps[$id]); unset($a_ppps[$id]); write_config(); header("Location: interfaces_ppps.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_ppps); $main_buttons = array(array('href' => 'interfaces_ppps_edit.php', 'label' => gettext('Add'))); ?>