Project

General

Profile

« Previous | Next » 

Revision 68d0b70a

Added by Ermal LUÇI over 15 years ago

Make pasthrough GUI code catch-up with the latest changes.

View differences:

etc/inc/captiveportal.inc
1011 1011

  
1012 1012
        if (file_exists("{$g['vardb_path']}/captiveportal.rules")) {
1013 1013
                $rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportal.rules"));
1014
		$ruleno = intval(`/sbin/ipfw show | /usr/bin/grep 00:0c:29:88:77:80 | /usr/bin/grep -v grep | /usr/bin/cut -d " " -f 1 | /usr/bin/head -n 1`);
1014
		$ruleno = intval(`/sbin/ipfw table 1 list | /usr/bin/grep {$value} |  /usr/bin/grep -v grep | /usr/bin/cut -d " " -f 1 | /usr/bin/head -n 1`);
1015 1015
		if ($rules[$ruleno])
1016 1016
			return $ruleno;
1017 1017
        }
usr/local/www/services_captiveportal_mac.php
59 59
		$retval = 0;
60 60

  
61 61
		$rules = captiveportal_passthrumac_configure();
62
		//file_put_contents("{$g['tmp_path']}/passthru.mac", $rules);
63
		//mwexec("/sbin/ipfw {$g['tmp_path']}/passthru.mac");
64

  
65 62
		$savemsg = get_std_save_message($retval);
66 63
		if ($retval == 0)
67 64
			clear_subsystem_dirty('passthrumac');
......
70 67

  
71 68
if ($_GET['act'] == "del") {
72 69
	if ($a_passthrumacs[$_GET['id']]) {
73
		$ruleno = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']);
74
		if ($ruleno) {
75
			mwexec("/sbin/ipfw delete {$ruleno}");
76
			captiveportal_free_ipfw_ruleno($ruleno);
77
			$ruleno++;
78
			mwexec("/sbin/ipfw delete {$ruleno}");
70
		$ip = captiveportal_get_ipfw_ruleno_byvalue($a_passthrumacs[$_GET['id']]['mac']);
71
		if ($ip) {
72
			captiveportal_disconnect_client($ip);
79 73
		}
80 74
		unset($a_passthrumacs[$_GET['id']]);
81 75
		write_config();

Also available in: Unified diff