Project

General

Profile

Download (1.63 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php-cgi -f
2
<?php
3
/*
4
 * rc.captiveportal_configure_mac
5
 *
6
 * part of pfSense (https://www.pfsense.org)
7
 * Copyright (c) 2015-2016 Electric Sheep Fencing
8
 * Copyright (c) 2015-2021 Rubicon Communications, LLC (Netgate)
9
 * All rights reserved.
10
 *
11
 * Licensed under the Apache License, Version 2.0 (the "License");
12
 * you may not use this file except in compliance with the License.
13
 * You may obtain a copy of the License at
14
 *
15
 * http://www.apache.org/licenses/LICENSE-2.0
16
 *
17
 * Unless required by applicable law or agreed to in writing, software
18
 * distributed under the License is distributed on an "AS IS" BASIS,
19
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
 * See the License for the specific language governing permissions and
21
 * limitations under the License.
22
 */
23

    
24
require_once("config.inc");
25
require_once("functions.inc");
26
require_once("filter.inc");
27
require_once("shaper.inc");
28
require_once("captiveportal.inc");
29

    
30
global $cpzone;
31

    
32
$cpzone = isset($_GET['cpzone']) ? $_GET['cpzone'] : trim($argv[1]);
33
$startidx = isset($_GET['startidx']) ? $_GET['startidx'] : trim($argv[2]);
34
$stopidx = isset($_GET['cpzone']) ? $_GET['stopidx'] : trim($argv[3]);
35

    
36
$cpzoneidx = $config['captiveportal'][$cpzone]['zoneid'];
37
$filename = "{$g['tmp_path']}/{$cpzoneidx}_mac_{$startidx}_{$stopidx}";
38

    
39
//log_error("STARTED: " . time() . " - {$cpzone} : $startidx : {$stopidx} : {$cpzoneidx} : {$filename}");
40
captiveportal_passthrumac_configure($filename, $startidx, $stopidx);
41
//log_error("STOPPED: " .time() . " - {$cpzone} : $startidx : {$stopidx} : {$cpzoneidx} : {$filename}");
42

    
43
mwexec("/sbin/ipfw -q {$filename}");
44
@unlink($filename);
45
?>
(23-23/82)