summaryrefslogtreecommitdiffstats
path: root/usr/local/captiveportal/index.php
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-05-09 04:16:06 +0000
committerErmal Luçi <eri@pfsense.org>2009-05-09 04:16:06 +0000
commitf80a6148bc41a5db7518a7f2d4909545f7ca28c4 (patch)
treea3f63dd10ee4cdb9a123e005754f72eef00d0b8d /usr/local/captiveportal/index.php
parent761858b179e2017f06e0cf20ebd06a6042642a7e (diff)
downloadpfsense-f80a6148bc41a5db7518a7f2d4909545f7ca28c4.zip
pfsense-f80a6148bc41a5db7518a7f2d4909545f7ca28c4.tar.gz
The other half of CP locks conversion to new locking functions.
Diffstat (limited to 'usr/local/captiveportal/index.php')
-rwxr-xr-xusr/local/captiveportal/index.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index 9d21b8d..906397f 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -198,7 +198,7 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
/* See if a ruleno is passed, if not start locking the sessions because this means there isn't one atm */
if ($ruleno == null) {
- captiveportal_lock();
+ $cplock = lock('captiveportal');
$ruleno = captiveportal_get_next_ipfw_ruleno();
}
@@ -206,7 +206,7 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
if (is_null($ruleno)) {
portal_reply_page($redirurl, "error", "System reached maximum login capacity");
log_error("WARNING! Captive portal has reached maximum login capacity");
- captiveportal_unlock();
+ unlock($cplock);
exit;
}
@@ -351,12 +351,12 @@ document.location.href="{$my_redirurl}";
EOD;
} else {
- captiveportal_unlock();
+ unlock($cplock);
header("Location: " . $my_redirurl);
return $sessionid;
}
- captiveportal_unlock();
+ unlock($cplock);
return $sessionid;
}
@@ -369,7 +369,7 @@ function disconnect_client($sessionid, $logoutReason = "LOGOUT", $term_cause = 1
global $g, $config;
- captiveportal_lock();
+ $cplock = lock('captiveportal');
/* read database */
$cpdb = captiveportal_read_db();
@@ -388,7 +388,7 @@ function disconnect_client($sessionid, $logoutReason = "LOGOUT", $term_cause = 1
/* write database */
captiveportal_write_db($cpdb);
- captiveportal_unlock();
+ unlock($cplock);
}
?>
OpenPOWER on IntegriCloud