diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-02-17 11:34:44 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-02-17 11:34:44 -0300 |
commit | 5705c60a24ce8a5887dda0f7c1a73231de42827e (patch) | |
tree | e03f1e22e4292db3ff8904fd043842259a05eb22 /usr | |
parent | 290296cdc05747b65145077e2715e7c4e2ae60aa (diff) | |
download | pfsense-5705c60a24ce8a5887dda0f7c1a73231de42827e.zip pfsense-5705c60a24ce8a5887dda0f7c1a73231de42827e.tar.gz |
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.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/bin/captiveportal_gather_stats.php | 4 | ||||
-rwxr-xr-x | usr/local/www/status_captiveportal.php | 14 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/captive_portal_status.widget.php | 18 |
3 files changed, 18 insertions, 18 deletions
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)) { </tr> <?php foreach ($cpdb as $cpent): ?> <tr> - <td class="listlr"><?=$cpent['ip'];?></td> - <td class="listr"><?=$cpent['mac'];?> </td> - <td class="listr"><?=$cpent['username'];?> </td> - <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $cpent['allow_time']));?></td> + <td class="listlr"><?=$cpent[2];?></td> + <td class="listr"><?=$cpent[3];?> </td> + <td class="listr"><?=$cpent[4];?> </td> + <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $cpent[0]));?></td> <?php if ($_GET['showact']): - $last_act = captiveportal_get_last_activity($cpent['ip']); ?> + $last_act = captiveportal_get_last_activity($cpent[2]); ?> <td class="listr"><?php if ($last_act != 0) echo htmlspecialchars(date("m/d/Y H:i:s", $last_act));?></td> <?php endif; ?> <td valign="middle" class="list" nowrap> - <a href="?zone=<?=$cpzone;?>&order=<?=$_GET['order'];?>&showact=<?=htmlspecialchars($_GET['showact']);?>&act=del&id=<?=$cpent['sessionid'];?>" onclick="return confirm('<?=gettext("Do you really want to disconnect this client?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("Disconnect");?>"></a></td> + <a href="?zone=<?=$cpzone;?>&order=<?=$_GET['order'];?>&showact=<?=htmlspecialchars($_GET['showact']);?>&act=del&id=<?=$cpent[5];?>" onclick="return confirm('<?=gettext("Do you really want to disconnect this client?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("Disconnect");?>"></a></td> </tr> <?php endforeach; endif; ?> </table> 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']) { </tr> <?php foreach ($cpdb_all as $cpent): ?> <tr> - <td class="listlr"><?=$cpent['ip'];?></td> - <td class="listr"><?=$cpent['mac'];?> </td> - <td class="listr"><?=$cpent['username'];?> </td> + <td class="listlr"><?=$cpent[2];?></td> + <td class="listr"><?=$cpent[3];?> </td> + <td class="listr"><?=$cpent[4];?> </td> <?php if ($_GET['showact']): ?> - <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $cpent['allow_time']));?></td> - <td class="listr"><?php if ($cpent['lastactivity'] && ($cpent['lastactivity'] > 0)) echo htmlspecialchars(date("m/d/Y H:i:s", $cpent['lastactivity']));?></td> + <td class="listr"><?=htmlspecialchars(date("m/d/Y H:i:s", $cpent[0]));?></td> + <td class="listr"><?php if ($cpent[11] && ($cpent[11] > 0)) echo htmlspecialchars(date("m/d/Y H:i:s", $cpent[11]));?></td> <?php endif; ?> <td valign="middle" class="list" nowrap> - <a href="?order=<?=$_GET['order'];?>&showact=<?=$_GET['showact'];?>&act=del&zone=<?=$cpent['zone'];?>&id=<?=$cpent['sessionid'];?>" onclick="return confirm('Do you really want to disconnect this client?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> + <a href="?order=<?=$_GET['order'];?>&showact=<?=$_GET['showact'];?>&act=del&zone=<?=$cpent[10];?>&id=<?=$cpent[5];?>" onclick="return confirm('Do you really want to disconnect this client?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td> </tr> <?php endforeach; ?> </table> |