Revision e79a872f
Added by Christian McDonald over 2 years ago
src/etc/inc/captiveportal.inc | ||
---|---|---|
68 | 68 |
// check if custombg is set and if the element exists |
69 | 69 |
if (isset($config['captiveportal'][$cpzone]['custombg']) && |
70 | 70 |
is_array($config['captiveportal'][$cpzone]['element']) && |
71 |
!empty($config['captiveportal'][$cpzone]['element'])) {
|
|
71 |
!empty($config['captiveportal'][$cpzone]['element'])) { |
|
72 | 72 |
foreach ($config['captiveportal'][$cpzone]['element'] as $element) { |
73 | 73 |
if (strpos($element['name'],"captiveportal-background.") !== false) { |
74 | 74 |
if( file_exists("{$g['captiveportal_path']}/{$element['name']}")) { |
... | ... | |
884 | 884 |
captiveportal_ether_delete_entry($host, 'auth'); |
885 | 885 |
} |
886 | 886 |
/* XXX: Redundant?! Ensure all pf(4) states are killed. */ |
887 |
$_gb = @pfSense_kill_states(utf8_encode($dbent[2]));
|
|
888 |
$_gb = @pfSense_kill_srcstates(utf8_encode($dbent[2]));
|
|
887 |
$_gb = @pfSense_kill_states($dbent[2]);
|
|
888 |
$_gb = @pfSense_kill_srcstates($dbent[2]);
|
|
889 | 889 |
} |
890 | 890 |
|
891 | 891 |
// XMLRPC Call over to the backup node if necessary |
... | ... | |
1972 | 1972 |
$remaining_time = 0; |
1973 | 1973 |
} |
1974 | 1974 |
|
1975 |
/* This user was already logged in so we disconnect the old one, or
|
|
1975 |
/* This user was already logged in so we disconnect the old one, or |
|
1976 | 1976 |
keep the old one, refusing the new login, or |
1977 | 1977 |
allow the login */ |
1978 | 1978 |
|
1979 | 1979 |
if (!isset($config['captiveportal'][$cpzone]['noconcurrentlogins'])) { |
1980 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 2 does not exists = NOT set");
|
|
1980 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 2 does not exists = NOT set"); |
|
1981 | 1981 |
} else { |
1982 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 2 exists = set");
|
|
1982 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 2 exists = set"); |
|
1983 | 1983 |
} |
1984 | 1984 |
|
1985 | 1985 |
if ($config['captiveportal'][$cpzone]['noconcurrentlogins'] == "last") { |
... | ... | |
1987 | 1987 |
} else { |
1988 | 1988 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "Found NOT last"); |
1989 | 1989 |
} |
1990 |
|
|
1990 |
|
|
1991 | 1991 |
if (!isset($config['captiveportal'][$cpzone]['noconcurrentlogins'])) { |
1992 | 1992 |
/* 'noconcurrentlogins' not set : accept login 'username' creating multiple sessions. */ |
1993 | 1993 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 3 does not exists = NOT set"); |
1994 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "CONCURRENT LOGIN - NOT TERMINATING EXISTING SESSION(S)");
|
|
1994 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "CONCURRENT LOGIN - NOT TERMINATING EXISTING SESSION(S)"); |
|
1995 | 1995 |
} elseif ($config['captiveportal'][$cpzone]['noconcurrentlogins'] == "last") { |
1996 | 1996 |
/* Classic situation : accept the new login, disconnect the old - present - connection */ |
1997 | 1997 |
if (isset($config['captiveportal'][$cpzone]['noconcurrentlogins'])) { |
1998 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 4 exists = set");
|
|
1998 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 4 exists = set"); |
|
1999 | 1999 |
} else { |
2000 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 4 does not exists = NOT set");
|
|
2000 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "config['captiveportal'][$cpzone]['noconcurrentlogins'] 4 does not exists = NOT set"); |
|
2001 | 2001 |
} |
2002 |
|
|
2002 |
|
|
2003 | 2003 |
captiveportal_disconnect($cpentry, 13); |
2004 | 2004 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "CONCURRENT LOGIN - TERMINATING OLD SESSION"); |
2005 | 2005 |
$unsetindexes[] = $cpentry[5]; |
... | ... | |
2024 | 2024 |
/* Implicit 'first' : refuse the new login - 'username' is already logged in */ |
2025 | 2025 |
captiveportal_logportalauth($cpentry[4], $cpentry[3], $cpentry[2], "CONCURRENT USER LOGIN - NOT ALLOWED KEEPING OLD SESSION "); |
2026 | 2026 |
unlock($cpdblck); |
2027 |
return 2;
|
|
2027 |
return 2; |
|
2028 | 2028 |
} |
2029 | 2029 |
} |
2030 | 2030 |
} |
... | ... | |
2307 | 2307 |
return true; |
2308 | 2308 |
} |
2309 | 2309 |
|
2310 |
function xmlrpc_sync_usedmacs($usedmacs) {
|
|
2310 |
function xmlrpc_sync_usedmacs($usedmacs) { |
|
2311 | 2311 |
global $config, $cpzone; |
2312 | 2312 |
|
2313 | 2313 |
// XMLRPC Call over to the other node |
... | ... | |
2558 | 2558 |
} |
2559 | 2559 |
|
2560 | 2560 |
function filter_captiveportal_aliases() { |
2561 |
/* return all aliases used in captive portal zones,
|
|
2561 |
/* return all aliases used in captive portal zones, |
|
2562 | 2562 |
* to prevent it from deletion in filter_configure_sync() as unused aliases */ |
2563 | 2563 |
global $g, $config; |
2564 | 2564 |
|
... | ... | |
2742 | 2742 |
if (isset($FilterIflist[$cpifgrp])) { |
2743 | 2743 |
$realif = get_real_interface($cpifgrp); |
2744 | 2744 |
if (!empty($realif) && get_interface_ip($realif)) { |
2745 |
$interfaces .= $realif . ' ';
|
|
2745 |
$interfaces .= $realif . ' '; |
|
2746 | 2746 |
} |
2747 | 2747 |
} |
2748 | 2748 |
} |
... | ... | |
2801 | 2801 |
$host = $hostent['ip'] . '_32'; |
2802 | 2802 |
$l3from = "l3 from {$hostent['ip']}"; |
2803 | 2803 |
$l3to = "l3 to {$hostent['ip']}"; |
2804 |
if (!isset($config['captiveportal'][$cpzone]['nomacfilter'])) {
|
|
2804 |
if (!isset($config['captiveportal'][$cpzone]['nomacfilter'])) { |
|
2805 | 2805 |
if (!empty($hostent['mac'])) { |
2806 | 2806 |
$macfrom = "from {$hostent['mac']}"; |
2807 | 2807 |
$macto = "to {$hostent['mac']}"; |
Also available in: Unified diff
Remove unnecessary utf8_encode'ing to pfSense_kill_states arguments. Partial #9270