summaryrefslogtreecommitdiffstats
path: root/usr
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
parent761858b179e2017f06e0cf20ebd06a6042642a7e (diff)
downloadpfsense-f80a6148bc41a5db7518a7f2d4909545f7ca28c4.zip
pfsense-f80a6148bc41a5db7518a7f2d4909545f7ca28c4.tar.gz
The other half of CP locks conversion to new locking functions.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/captiveportal/index.php12
-rwxr-xr-xusr/local/www/status_captiveportal.php4
-rw-r--r--usr/local/www/widgets/widgets/captive_portal_status.widget.php4
3 files changed, 10 insertions, 10 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);
}
?>
diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php
index adfcc0f..e83e920 100755
--- a/usr/local/www/status_captiveportal.php
+++ b/usr/local/www/status_captiveportal.php
@@ -64,7 +64,7 @@ function clientcmp($a, $b) {
}
$cpdb = array();
-captiveportal_lock();
+$cpdblck = lock('captiveportal');
$fp = @fopen("{$g['vardb_path']}/captiveportal.db","r");
if ($fp) {
@@ -94,7 +94,7 @@ if ($fp) {
usort($cpdb, "clientcmp");
}
}
-captiveportal_unlock();
+unlock($cpdblck);
?>
<table class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
diff --git a/usr/local/www/widgets/widgets/captive_portal_status.widget.php b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
index c3b38ab..74ec780 100644
--- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php
+++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php
@@ -55,7 +55,7 @@ function clientcmp($a, $b) {
}
$cpdb = array();
-captiveportal_lock();
+$wdgcplck = lock('captiveportal');
$fp = @fopen("{$g['vardb_path']}/captiveportal.db","r");
if ($fp) {
@@ -83,7 +83,7 @@ if ($fp) {
usort($cpdb, "clientcmp");
}
}
-captiveportal_unlock();
+unlock($wdgcplck);
?>
<table class="sortable" name="sortabletable" id="sortabletable" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
OpenPOWER on IntegriCloud