'→', 'from' => '←', 'both' => '⇄'); $notestr = gettext('Adding new hostnames will allow a DNS hostname access to/from the captive portal without being taken to the portal page.' . 'This can be used for a web server serving images for the portal page, or a DNS server on another network, for example. ' . 'By specifying from addresses, it may be used to always allow pass-through access from a client behind the captive portal.'); require("guiconfig.inc"); require("functions.inc"); require_once("filter.inc"); require("shaper.inc"); require("captiveportal.inc"); $cpzone = $_GET['zone']; if (isset($_POST['zone'])) { $cpzone = $_POST['zone']; } if (empty($cpzone) || empty($config['captiveportal'][$cpzone])) { header("Location: services_captiveportal_zones.php"); exit; } if (!is_array($config['captiveportal'])) { $config['captiveportal'] = array(); } $a_cp =& $config['captiveportal']; if (isset($cpzone) && !empty($cpzone) && isset($a_cp[$cpzone]['zoneid'])) { $cpzoneid = $a_cp[$cpzone]['zoneid']; } $pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Allowed Hostnames")); $shortcut_section = "captiveportal"; if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) { $a_allowedhostnames =& $a_cp[$cpzone]['allowedhostname']; if ($a_allowedhostnames[$_GET['id']]) { $ipent = $a_allowedhostnames[$_GET['id']]; if (isset($a_cp[$cpzone]['enable'])) { if (is_ipaddr($ipent['hostname'])) { $ip = $ipent['hostname']; } else { $ip = gethostbyname($ipent['hostname']); } $sn = (is_ipaddrv6($ip)) ? 128 : 32; if (is_ipaddr($ip)) { $ipfw = pfSense_ipfw_getTablestats($cpzoneid, IP_FW_TABLE_XLISTENTRY, 3, $ip); if (is_array($ipfw)) { captiveportal_free_dn_ruleno($ipfw['dnpipe']); pfSense_pipe_action("pipe delete {$ipfw['dnpipe']}"); pfSense_pipe_action("pipe delete " . ($ipfw['dnpipe']+1)); } pfSense_ipfw_Tableaction($cpzoneid, IP_FW_TABLE_XDEL, 3, $ip, $sn); pfSense_ipfw_Tableaction($cpzoneid, IP_FW_TABLE_XDEL, 4, $ip, $sn); } } unset($a_allowedhostnames[$_GET['id']]); write_config(); captiveportal_allowedhostname_configure(); header("Location: services_captiveportal_hostname.php?zone={$cpzone}"); exit; } } include("head.inc"); if ($savemsg) { print_info_box($savemsg, 'success'); } $tab_array = array(); $tab_array[] = array(gettext("Configuration"), false, "services_captiveportal.php?zone={$cpzone}"); $tab_array[] = array(gettext("MAC"), false, "services_captiveportal_mac.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed IP Addresses"), false, "services_captiveportal_ip.php?zone={$cpzone}"); $tab_array[] = array(gettext("Allowed Hostnames"), true, "services_captiveportal_hostname.php?zone={$cpzone}"); $tab_array[] = array(gettext("Vouchers"), false, "services_captiveportal_vouchers.php?zone={$cpzone}"); $tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}"); display_top_tabs($tab_array, true); ?>
=gettext("Hostname"); ?> | =gettext("Description"); ?> | |
---|---|---|
=$directionicons[$ip['dir']]?> =strtolower($ip['hostname'])?> | =htmlspecialchars($ip['descr'])?> | " href="services_captiveportal_hostname_edit.php?zone==$cpzone?>&id==$i?>"> " href="services_captiveportal_hostname.php?zone==$cpzone?>&act=del&id==$i?>"> |