diff options
author | smos <seth.mos@dds.nl> | 2010-07-23 16:04:39 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2010-07-23 16:04:39 +0200 |
commit | edd2d8b736bb445880fb70f4413875d450a6ec54 (patch) | |
tree | 379502f71b0b2c03739dabeb75ad24ce59f1ad64 /usr | |
parent | 55c08a96455fbb86ef5107b89babf88499507f84 (diff) | |
download | pfsense-edd2d8b736bb445880fb70f4413875d450a6ec54.zip pfsense-edd2d8b736bb445880fb70f4413875d450a6ec54.tar.gz |
Add OpenVPN users database, sync the tabs on the settings page.
Graphing page doesn't know about openvpn users yet. But that's ok.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 26 | ||||
-rwxr-xr-x | usr/local/www/status_rrd_graph_settings.php | 43 |
2 files changed, 38 insertions, 31 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index 036a3b2..08e2df3 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -109,9 +109,9 @@ if ($_GET['option']) { continue 2; } } - case "vpn": + case "vpnusers": foreach($databases as $database) { - if(preg_match("/[-]vpn\.rrd/i", $database)) { + if(preg_match("/[-]vpnusers\.rrd/i", $database)) { /* pick off the 1st database we find that matches the VPN graphs */ $name = explode("-", $database); $curoption = "$name[0]"; @@ -167,7 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd", "allgraphs-quality.rrd", "allgraphs-wireless.rrd", "allgraphs-cellular.rrd", - "allgraphs-vpn.rrd", + "allgraphs-vpnusers.rrd", "allgraphs-packets.rrd", "system-allgraphs.rrd", "system-throughput.rrd", @@ -176,17 +176,17 @@ $dbheader = array("allgraphs-traffic.rrd", "outbound-traffic.rrd"); foreach($databases as $database) { - if(stristr($database, "wireless")) { + if(stristr($database, "-wireless")) { $wireless = true; } - if(stristr($database, "queues")) { + if(stristr($database, "-queues")) { $queues = true; } - if(stristr($database, "cellular")) { + if(stristr($database, "-cellular")) { $cellular = true; } - if(stristr($database, "vpn")) { - $vpn = true; + if(stristr($database, "-vpnusers")) { + $vpnusers = true; } } /* append the existing array to the header */ @@ -278,9 +278,9 @@ function get_dates($curperiod, $graph) { $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); if($queues) { if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); + $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); + $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); } if($wireless) { if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } @@ -290,9 +290,9 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } - if($vpn) { - if($curcat == "vpn") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpn"); + if($vpnusers) { + if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers"); } if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index d1398c4..7f8d4ae 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -106,32 +106,39 @@ include("head.inc"); <tr> <td> <?php - $tab_array = array(); - if($curcat == "system") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("System", $tabactive, "status_rrd_graph.php?cat=system"); - if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Traffic", $tabactive, "status_rrd_graph.php?cat=traffic"); - if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Packets", $tabactive, "status_rrd_graph.php?cat=packets"); - if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); + $tab_array = array(); + if($curcat == "system") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("System", $tabactive, "status_rrd_graph.php?cat=system"); + if($curcat == "traffic") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Traffic", $tabactive, "status_rrd_graph.php?cat=traffic"); + if($curcat == "packets") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Packets", $tabactive, "status_rrd_graph.php?cat=packets"); + if($curcat == "quality") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Quality", $tabactive, "status_rrd_graph.php?cat=quality"); if($queues) { - if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); + if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Queues", $tabactive, "status_rrd_graph.php?cat=queues"); if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); + $tab_array[] = array("QueueDrops", $tabactive, "status_rrd_graph.php?cat=queuedrops"); } if($wireless) { - if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless"); + if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Wireless", $tabactive, "status_rrd_graph.php?cat=wireless"); } if($cellular) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); + $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); } - if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php"); - display_top_tabs($tab_array); + if($vpnusers) { + if($curcat == "vpnusers") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("VPN", $tabactive, "status_rrd_graph.php?cat=vpnusers"); + } + if($curcat == "custom") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Custom", $tabactive, "status_rrd_graph.php?cat=custom"); + if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Settings", $tabactive, "status_rrd_graph_settings.php"); + + display_top_tabs($tab_array); ?> </td> </tr> |