From 5705c60a24ce8a5887dda0f7c1a73231de42827e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Sun, 17 Feb 2013 11:34:44 -0300 Subject: Revert "Merge pull request #417 from miken32/cp-database-fix" It breaks customizations, it's not a good time for such big change. This reverts commit 40c7b1a98bfdc61261154adaac5fdefc234ecb08, reversing changes made to d896f86751bae79625197da6c80d709fdf185448. --- usr/local/bin/captiveportal_gather_stats.php | 4 ++-- usr/local/www/status_captiveportal.php | 14 +++++++------- .../widgets/widgets/captive_portal_status.widget.php | 18 +++++++++--------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'usr') diff --git a/usr/local/bin/captiveportal_gather_stats.php b/usr/local/bin/captiveportal_gather_stats.php index 3ff03dd..63d91a2 100644 --- a/usr/local/bin/captiveportal_gather_stats.php +++ b/usr/local/bin/captiveportal_gather_stats.php @@ -77,9 +77,9 @@ if ($type == "loggedin") { @fclose($fd); foreach($cpdb as $user) { - $user_ip = $user['ip']; + $user_ip = $user[2]; // Record the timestamp - $timestamp = $user['allow_time']; + $timestamp = $user[0]; if ($timestamp > $previous_user_timestamp) $current_user_count = $current_user_count + 1; } diff --git a/usr/local/www/status_captiveportal.php b/usr/local/www/status_captiveportal.php index 15a2227..2e303b6 100755 --- a/usr/local/www/status_captiveportal.php +++ b/usr/local/www/status_captiveportal.php @@ -50,7 +50,7 @@ if (isset($_POST['zone'])) $cpzone = $_POST['zone']; if ($_GET['act'] == "del" && !empty($cpzone)) { - captiveportal_disconnect_client($_GET['id'], RADIUS_TERM_ADMIN_RESET); + captiveportal_disconnect_client($_GET['id']); Header("Location: status_captiveportal.php?zone={$cpzone}"); exit; } @@ -156,16 +156,16 @@ if (!empty($cpzone)) { - -   -   - + +   +   + + $last_act = captiveportal_get_last_activity($cpent[2]); ?> - ')">"> + ')">"> 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 1393fc0..2db0a2a 100644 --- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php +++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php @@ -46,7 +46,7 @@ require_once("captiveportal.inc"); if (($_GET['act'] == "del") && (!empty($_GET['zone']))) { $cpzone = $_GET['zone']; - captiveportal_disconnect_client($_GET['id'], RADIUS_TERM_ADMIN_RESET); + captiveportal_disconnect_client($_GET['id']); } flush(); @@ -65,9 +65,9 @@ $cpdb_all = array(); foreach ($a_cp as $cpzone => $cp) { $cpdb = captiveportal_read_db(); foreach ($cpdb as $cpent) { - $cpent['zone'] = $cpzone; + $cpent[10] = $cpzone; if ($_GET['showact']) - $cpent['lastactivity'] = captiveportal_get_last_activity($cpent['ip']); + $cpent[11] = captiveportal_get_last_activity($cpent[2]); $cpdb_all[] = $cpent; } } @@ -100,15 +100,15 @@ if ($_GET['order']) { - -   -   + +   +   - - 0)) echo htmlspecialchars(date("m/d/Y H:i:s", $cpent['lastactivity']));?> + + 0)) echo htmlspecialchars(date("m/d/Y H:i:s", $cpent[11]));?> - + -- cgit v1.1