summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal_mac.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-04-20 00:39:16 +0000
committerErmal <eri@pfsense.org>2010-04-20 00:40:02 +0000
commit6ce61a8fd6423e5b7cd851ebbfab3486523db9b6 (patch)
tree64dbac1a32815d2de8f3181e3bc52f81c8fcbd9b /usr/local/www/services_captiveportal_mac.php
parentc443bb14cb89462e8f19f8e60527b970f3344bfb (diff)
downloadpfsense-6ce61a8fd6423e5b7cd851ebbfab3486523db9b6.zip
pfsense-6ce61a8fd6423e5b7cd851ebbfab3486523db9b6.tar.gz
Add a new option which allows the admin user to configure CP so that it automatically enters an MAC passthru entry. The MAC is taken from login details and has to be removed manually. Also do improvements on rules handling and pipes. Add some optmizations. Teach the GUI/backend on ip/mac passthrough to configure a bw limit for this entries.
Diffstat (limited to 'usr/local/www/services_captiveportal_mac.php')
-rwxr-xr-xusr/local/www/services_captiveportal_mac.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/local/www/services_captiveportal_mac.php b/usr/local/www/services_captiveportal_mac.php
index 5080c0c..ca900bf 100755
--- a/usr/local/www/services_captiveportal_mac.php
+++ b/usr/local/www/services_captiveportal_mac.php
@@ -50,6 +50,7 @@ if (!is_array($config['captiveportal']['passthrumac']))
$a_passthrumacs = &$config['captiveportal']['passthrumac'] ;
+
if ($_POST) {
$pconfig = $_POST;
@@ -57,7 +58,9 @@ if ($_POST) {
if ($_POST['apply']) {
$retval = 0;
- $retval = captiveportal_passthrumac_configure();
+ $rules = captiveportal_passthrumac_configure();
+ file_put_contents("{$g['tmp_path']}/passthru.mac", $rules);
+ mwexec("/sbin/ipfw {$g['tmp_path']}/passthru.mac");
$savemsg = get_std_save_message($retval);
if ($retval == 0)
@@ -67,10 +70,17 @@ if ($_POST) {
if ($_GET['act'] == "del") {
if ($a_passthrumacs[$_GET['id']]) {
+ $ruleno = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']);
+ if ($ruleno) {
+ mwexec("/sbin/ipfw delete {$ruleno}");
+ captiveportal_free_ipfw_ruleno($ruleno);
+ $ruleno++;
+ mwexec("/sbin/ipfw delete {$ruleno}");
+ }
unset($a_passthrumacs[$_GET['id']]);
write_config();
- mark_subsystem_dirty('passthrumac');
header("Location: services_captiveportal_mac.php");
+ //mark_subsystem_dirty('passthrumac');
exit;
}
}
OpenPOWER on IntegriCloud