exit; } if (!is_array($config['captiveportal'])) { $config['captiveportal'] = array(); } $a_cp =& $config['captiveportal']; $pgtitle = array(gettext("Services"), gettext("Captive Portal"), sprintf(gettext("Zone: %s"), $a_cp[$cpzone]['zone']), gettext("MACs")); $shortcut_section = "captiveportal"; $actsmbl = array('pass' => '<font color="green" size="4">✔</font> ' . gettext("Pass"), 'block' => '<font color="red" size="4">✘</font> ' . gettext("Block")); if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; if (is_array($a_cp[$cpzone]['passthrumac'])) { $cpzoneid = $a_cp[$cpzone]['cpzoneid']; $rules = captiveportal_passthrumac_configure(); if (!empty($rules)) { @file_put_contents("{$g['tmp_path']}/passthrumac_gui", $rules); mwexec("/sbin/ipfw -x {$cpzoneid} {$g['tmp_path']}/passthrumac_gui"); @unlink("{$g['tmp_path']}/passthrumac_gui"); } $savemsg = get_std_save_message($retval); if ($retval == 0) { clear_subsystem_dirty('passthrumac'); } } } if ($_POST['postafterlogin']) { if (!is_array($a_passthrumacs)) { echo gettext("No entry exists yet!") . "\n"; exit;
<?php $pgtitle = "Servisler:Hotspot"; require "guiconfig.inc"; if (!is_array($config['captiveportal']['passthrumac'])) { $config['captiveportal']['passthrumac'] = array(); } passthrumacs_sort(); $a_passthrumacs =& $config['captiveportal']['passthrumac']; if ($_POST) { $pconfig = $_POST; if ($_POST['apply']) { $retval = 0; $retval = captiveportal_passthrumac_configure(); $savemsg = get_std_save_message($retval); if ($retval == 0) { if (file_exists($d_passthrumacsdirty_path)) { config_lock(); unlink($d_passthrumacsdirty_path); config_unlock(); } } } } if ($_GET['act'] == "del") { if ($a_passthrumacs[$_GET['id']]) { unset($a_passthrumacs[$_GET['id']]); write_config(); touch($d_passthrumacsdirty_path); header("Location: services_captiveportal_mac.php"); exit;