From 916894efe8d45779a936630e368e6f54d4593dd0 Mon Sep 17 00:00:00 2001 From: jdegraeve Date: Thu, 2 Mar 2006 15:20:51 +0000 Subject: [PATCH] Change the portal_allow function to use attribute array, every other code should still be working with this change git-svn-id: https://svn.m0n0.ch/wall/trunk@93 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- captiveportal/index.php | 8 ++++++-- phpconf/inc/captiveportal.inc | 5 +---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/captiveportal/index.php b/captiveportal/index.php index 490d973..db28cec 100755 --- a/captiveportal/index.php +++ b/captiveportal/index.php @@ -232,10 +232,14 @@ function portal_mac_radius($clientmac,$clientip) { return FALSE; } -function portal_allow($clientip,$clientmac,$clientuser,$password = null, $session_timeout = null, $idle_timeout = null, $url_redirection = null, $session_terminate_time = null) { +function portal_allow($clientip,$clientmac,$clientuser,$password = null, $attributes) { global $redirurl, $g, $config; + // Ensure we create an array if we are missing attributes + if (!is_array($attributes)) + $attributes = array(); + if ((isset($config['captiveportal']['noconcurrentlogins'])) && ($clientuser != 'unauthenticated')) kick_concurrent_logins($clientuser); @@ -286,7 +290,7 @@ function portal_allow($clientip,$clientmac,$clientuser,$password = null, $sessio /* encode password in Base64 just in case it contains commas */ $bpassword = base64_encode($password); - $cpdb[] = array(time(), $ruleno, $clientip, $clientmac, $clientuser, $sessionid, $bpassword, $session_timeout, $idle_timeout, $session_terminate_time); + $cpdb[] = array(time(), $ruleno, $clientip, $clientmac, $clientuser, $sessionid, $bpassword, $attributes['session_timeout'], $attributes['idle_timeout'], $attributes['session_terminate_time']); /* rewrite information to database */ captiveportal_write_db($cpdb); diff --git a/phpconf/inc/captiveportal.inc b/phpconf/inc/captiveportal.inc index 14bfe39..18fa767 100644 --- a/phpconf/inc/captiveportal.inc +++ b/phpconf/inc/captiveportal.inc @@ -798,10 +798,7 @@ function radius($username,$password,$clientip,$clientmac,$type) { $clientmac, $username, $password, - $auth_list['session_timeout'], - $auth_list['idle_timeout'], - $auth_list['url_redirection'], - $auth_list['session_terminate_time']); + $auth_list); if ($radacct_enable) { $auth_list['acct_val'] = RADIUS_ACCOUNTING_START($next_ruleno, -- 2.25.1