Revision fe7e987e
Added by Ermal LUÇI over 12 years ago
etc/inc/captiveportal.inc | ||
---|---|---|
1371 | 1371 |
} |
1372 | 1372 |
|
1373 | 1373 |
function captiveportal_get_dn_passthru_ruleno($value) { |
1374 |
global $config, $g, $cpzone; |
|
1375 |
|
|
1376 |
$cpcfg = $config['captiveportal'][$cpzone]; |
|
1377 |
if(!isset($cpcfg['enable'])) |
|
1378 |
return NULL; |
|
1374 |
global $config, $g; |
|
1379 | 1375 |
|
1380 |
$cpruleslck = lock("captiveportalrules{$cpzone}", LOCK_EX);
|
|
1381 |
if (file_exists("{$g['vardb_path']}/captiveportal_{$cpzone}.rules")) {
|
|
1382 |
$rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportal_{$cpzone}.rules"));
|
|
1376 |
$cpruleslck = lock("captiveportalrulesdn", LOCK_EX);
|
|
1377 |
if (file_exists("{$g['vardb_path']}/captiveportaldn.rules")) {
|
|
1378 |
$rules = unserialize(file_get_contents("{$g['vardb_path']}/captiveportaldn.rules"));
|
|
1383 | 1379 |
captiveportal_ipfw_set_context($cpzone); |
1384 | 1380 |
$ruleno = intval(`/sbin/ipfw show | /usr/bin/grep {$value} | /usr/bin/grep -v grep | /usr/bin/cut -d " " -f 5 | /usr/bin/head -n 1`); |
1385 | 1381 |
if ($rules[$ruleno]) { |
Also available in: Unified diff
Various fixes to removal of pipes