From f80a6148bc41a5db7518a7f2d4909545f7ca28c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Sat, 9 May 2009 04:16:06 +0000 Subject: The other half of CP locks conversion to new locking functions. --- usr/local/captiveportal/index.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr/local/captiveportal/index.php') 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); } ?> -- cgit v1.1