diff options
author | Michael Newton <miken32@gmail.com> | 2013-02-14 21:14:38 -0800 |
---|---|---|
committer | Michael Newton <miken32@gmail.com> | 2013-02-14 21:14:38 -0800 |
commit | 91ca7e9fa01bec4e6c9e83674cb109806a67df51 (patch) | |
tree | 42c12f1b96fef68dacd2561e13917140a1023376 /usr/local/www/widgets | |
parent | 2ccc41c1c537994e10c9deb4ac061ce55edb6537 (diff) | |
download | pfsense-91ca7e9fa01bec4e6c9e83674cb109806a67df51.zip pfsense-91ca7e9fa01bec4e6c9e83674cb109806a67df51.tar.gz |
use associative array for captive portal to prevent confusion, messiness, and abuse
Diffstat (limited to 'usr/local/www/widgets')
-rw-r--r-- | usr/local/www/widgets/widgets/captive_portal_status.widget.php | 16 |
1 files changed, 8 insertions, 8 deletions
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 2db0a2a..48651d7 100644 --- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php +++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php @@ -65,9 +65,9 @@ $cpdb_all = array(); foreach ($a_cp as $cpzone => $cp) { $cpdb = captiveportal_read_db(); foreach ($cpdb as $cpent) { - $cpent[10] = $cpzone; + $cpent['zone'] = $cpzone; if ($_GET['showact']) - $cpent[11] = captiveportal_get_last_activity($cpent[2]); + $cpent['lastactivity'] = captiveportal_get_last_activity($cpent['ip']); $cpdb_all[] = $cpent; } } @@ -100,15 +100,15 @@ if ($_GET['order']) { </tr> <?php foreach ($cpdb_all as $cpent): ?> <tr> - <td class="listlr"><?=$cpent[2];?></td> - <td class="listr"><?=$cpent[3];?> </td> - <td class="listr"><?=$cpent[4];?> </td> + <td class="listlr"><?=$cpent['ip'];?></td> + <td class="listr"><?=$cpent['mac'];?> </td> + <td class="listr"><?=$cpent['username'];?> </td> <?php if ($_GET['showact']): ?> - <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> + <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> <?php endif; ?> <td valign="middle" class="list" nowrap> - <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> + <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> </tr> <?php endforeach; ?> </table> |