summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-09-25 02:11:37 -0600
committerErik Fonnesbeck <efonnes@gmail.com>2010-09-25 02:36:33 -0600
commit8015e67bba6b910d30b3563395bd94b9f4d379ba (patch)
tree19bf63e65c5d994816e75b50b5779a4597691bec /usr/local/captiveportal
parente65d1a98b2f6869dfe718731b63581535b50db65 (diff)
downloadpfsense-8015e67bba6b910d30b3563395bd94b9f4d379ba.zip
pfsense-8015e67bba6b910d30b3563395bd94b9f4d379ba.tar.gz
Separate this control structure from the one before it, change the order, and rename the function.
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-xusr/local/captiveportal/index.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index 6428a91..1839f0a 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -127,6 +127,11 @@ exit;
/* radius functions handle everything so we exit here since we're done */
exit;
+} else if (portal_consume_passthrough_credit($clientmac)) {
+ /* allow the client through if it had a pass-through credit for its MAC */
+ captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT");
+ portal_allow($clientip, $clientmac, "unauthenticated");
+
} else if ($_POST['accept'] && $_POST['auth_voucher']) {
$voucher = trim($_POST['auth_voucher']);
@@ -188,7 +193,7 @@ exit;
captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
portal_reply_page($redirurl, "error", $errormsg);
}
-} else if ( ($_POST['accept'] && $clientip) || portal_consume_free_login($clientmac) ) {
+} else if ($_POST['accept'] && $clientip) {
captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT");
portal_allow($clientip, $clientmac, "unauthenticated");
} else {
@@ -526,12 +531,12 @@ function disconnect_client($sessionid, $logoutReason = "LOGOUT", $term_cause = 1
}
/*
- * Used when a limited number of free logins are allowed.
+ * Used for when pass-through credits are enabled.
* Returns true when there was at least one free login to deduct for the MAC.
* Expired entries are removed as they are seen.
* Active entries are updated according to the configuration.
*/
-function portal_consume_free_login($clientmac) {
+function portal_consume_passthrough_credit($clientmac) {
global $config;
if (!empty($config['captiveportal']['freelogins_count']) && is_numeric($config['captiveportal']['freelogins_count']))
@@ -553,7 +558,7 @@ function portal_consume_free_login($clientmac) {
/*
* Read database of used MACs. Lines are a comma-separated list
- * of the time, MAC, then the count of free logins remaining.
+ * of the time, MAC, then the count of pass-through credits remaining.
*/
$usedmacs = captiveportal_read_usedmacs_db();
OpenPOWER on IntegriCloud