Revision 6c07db48
Added by Phil Davis about 10 years ago
etc/inc/captiveportal.inc | ||
---|---|---|
1825 | 1825 |
$ourhostname .= ":" . $listenporthttps; |
1826 | 1826 |
} |
1827 | 1827 |
} else { |
1828 |
$listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : ($cpcfg['zoneid'] + 8000);
|
|
1828 |
$listenporthttp = $cpcfg['listenporthttp'] ? $cpcfg['listenporthttp'] : ($cpcfg['zoneid'] + 8000);
|
|
1829 | 1829 |
$ifip = portal_ip_from_client_ip($cliip); |
1830 | 1830 |
if (!$ifip) { |
1831 | 1831 |
$ourhostname = "{$config['system']['hostname']}.{$config['system']['domain']}"; |
... | ... | |
1930 | 1930 |
unset($bw_up_pipeno, $bw_down_pipeno, $bw_up, $bw_down); |
1931 | 1931 |
} |
1932 | 1932 |
|
1933 |
function portal_allow($clientip, $clientmac, $username, $password = null, $attributes = null, $pipeno = null, $radiusctx = null) {
|
|
1933 |
function portal_allow($clientip, $clientmac, $username, $password = null, $attributes = null, $pipeno = null, $radiusctx = null) { |
|
1934 | 1934 |
global $redirurl, $g, $config, $type, $passthrumac, $_POST, $cpzone, $cpzoneid; |
1935 | 1935 |
|
1936 | 1936 |
// Ensure we create an array if we are missing attributes |
... | ... | |
2073 | 2073 |
} |
2074 | 2074 |
} |
2075 | 2075 |
if ($username == "unauthenticated") { |
2076 |
$mac['descr'] = "Auto-added";
|
|
2076 |
$mac['descr'] = "Auto-added"; |
|
2077 | 2077 |
} else { |
2078 |
$mac['descr'] = "Auto-added for user {$username}";
|
|
2078 |
$mac['descr'] = "Auto-added for user {$username}"; |
|
2079 | 2079 |
} |
2080 | 2080 |
if (!empty($bw_up)) { |
2081 | 2081 |
$mac['bw_up'] = $bw_up; |
... | ... | |
2149 | 2149 |
|
2150 | 2150 |
/* encode password in Base64 just in case it contains commas */ |
2151 | 2151 |
$bpassword = base64_encode($password); |
2152 |
$insertquery = "INSERT INTO captiveportal (allow_time, pipeno, ip, mac, username, sessionid, bpassword, session_timeout, idle_timeout, session_terminate_time, interim_interval, radiusctx) ";
|
|
2152 |
$insertquery = "INSERT INTO captiveportal (allow_time, pipeno, ip, mac, username, sessionid, bpassword, session_timeout, idle_timeout, session_terminate_time, interim_interval, radiusctx) "; |
|
2153 | 2153 |
$insertquery .= "VALUES ({$allow_time}, {$pipeno}, '{$clientip}', '{$clientmac}', '{$safe_username}', '{$sessionid}', '{$bpassword}', "; |
2154 | 2154 |
$insertquery .= "{$session_timeout}, {$idle_timeout}, {$session_terminate_time}, {$interim_interval}, '{$radiusctx}')"; |
2155 | 2155 |
|
Also available in: Unified diff
Code spacing
and other random stuff I noticed.
I think this finishes messing with code style. The codebase should match
the developer style guide closely enough that 99.9% of changes will not
feel the need to also massage the formatting.