diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-07-26 16:17:16 -0300 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2010-07-26 16:17:16 -0300 |
commit | d9a0c4b8e86b193821b67783982e66370b399629 (patch) | |
tree | a38c6290dbdd9854c57f73dd001d1e9901a53d1e /usr/local | |
parent | 188097024801509c431899e7d9d4382e0a05b204 (diff) | |
parent | 4cb9abc3dc4b1faf42f4f8607772f9b652341209 (diff) | |
download | pfsense-d9a0c4b8e86b193821b67783982e66370b399629.zip pfsense-d9a0c4b8e86b193821b67783982e66370b399629.tar.gz |
Merge remote branch 'mainline/master'
Conflicts:
usr/local/www/services_rfc2136.php
usr/local/www/services_snmp.php
usr/local/www/status_rrd_graph.php
usr/local/www/status_rrd_graph_settings.php
Diffstat (limited to 'usr/local')
27 files changed, 212 insertions, 87 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 793a9ae..44dee95 100755 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -107,7 +107,7 @@ include("head.inc"); <p> <table class="tabcont sortable" width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td class="listhdrr"><b><center>Carp Interface</center></b></td> + <td class="listhdrr"><b><center>CARP Interface</center></b></td> <td class="listhdrr"><b><center>Virtual IP</center></b></td> <td class="listhdrr"><b><center>Status</center></b></td> </tr> diff --git a/usr/local/www/diag_logs_relayd.php b/usr/local/www/diag_logs_relayd.php index 8ce35b8..57df0e1 100755 --- a/usr/local/www/diag_logs_relayd.php +++ b/usr/local/www/diag_logs_relayd.php @@ -5,7 +5,7 @@ part of pfSense Copyright (C) 2008 Bill Marquette <bill.marquette@gmail.com>. - Copyright (C) 2008 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2008 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/firewall_shaper.php b/usr/local/www/firewall_shaper.php index 6618389..e456c61 100755 --- a/usr/local/www/firewall_shaper.php +++ b/usr/local/www/firewall_shaper.php @@ -341,9 +341,9 @@ $tree .= "</ul>"; if (!$dontshow || $newqueue) { -$output_form .= "<tr><td width=\"22%\" valign=\"top\" class=\"vncellreq\">"; -$output_form .= "Queue Actions"; -$output_form .= "</td><td valign=\"top\" class=\"vncellreq\" width=\"78%\">"; +$output_form .= "<tr><td width=\"22%\" valign=\"center\" class=\"vncellreq\">"; +$output_form .= "<br />Queue Actions<br />"; +$output_form .= "</td><td valign=\"center\" class=\"vncellreq\" width=\"78%\"><br />"; $output_form .= "<input type=\"submit\" name=\"Submit\" value=\"" . gettext("Save") . "\" class=\"formbtn\" />"; if ($can_add || $addnewaltq) { @@ -368,9 +368,9 @@ if ($can_add || $addnewaltq) { $output_form .= " value=\"Disable shaper on interface\">"; $output_form .= "</a>"; } -$output_form .= "</td></tr>"; +$output_form .= "<br /></td></tr>"; $output_form .= "</div>"; -} +} else $output_form .= "</div>"; diff --git a/usr/local/www/services_captiveportal_ip.php b/usr/local/www/services_captiveportal_ip.php index 505169e..692ff3d 100755 --- a/usr/local/www/services_captiveportal_ip.php +++ b/usr/local/www/services_captiveportal_ip.php @@ -60,10 +60,16 @@ if ($_GET['act'] == "del") { $ipent = $a_allowedips[$_GET['id']]; if (isset($config['captiveportal']['enable'])) { + if (!empty($ipent['sn'])) + $ipent['ip'] .= "/{$ipent['sn']}"; mwexec("/sbin/ipfw table 3 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 4 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 5 delete " . $ipent['ip']); mwexec("/sbin/ipfw table 6 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 7 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 8 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 9 delete " . $ipent['ip']); + mwexec("/sbin/ipfw table 10 delete " . $ipent['ip']); } unset($a_allowedips[$_GET['id']]); diff --git a/usr/local/www/services_captiveportal_ip_edit.php b/usr/local/www/services_captiveportal_ip_edit.php index f630afa..fecaccb 100755 --- a/usr/local/www/services_captiveportal_ip_edit.php +++ b/usr/local/www/services_captiveportal_ip_edit.php @@ -71,6 +71,7 @@ if (isset($_POST['id'])) if (isset($id) && $a_allowedips[$id]) { $pconfig['ip'] = $a_allowedips[$id]['ip']; + $pconfig['sn'] = $a_allowedips[$id]['sn']; $pconfig['dir'] = $a_allowedips[$id]['dir']; $pconfig['bw_up'] = $a_allowedips[$id]['bw_up']; $pconfig['bw_down'] = $a_allowedips[$id]['bw_down']; @@ -109,6 +110,7 @@ if ($_POST) { if (!$input_errors) { $ip = array(); $ip['ip'] = $_POST['ip']; + $ip['sn'] = $_POST['sn']; $ip['dir'] = $_POST['dir']; $ip['descr'] = $_POST['descr']; if ($_POST['bw_up']) @@ -117,9 +119,13 @@ if ($_POST) { $ip['bw_down'] = $_POST['bw_down']; if (isset($id) && $a_allowedips[$id]) { $oldip = $a_allowedips[$id]['ip']; + if (!empty($a_allowedips[$id]['sn'])) + $oldip .= "/{$a_allowedips[$id]['sn']}"; $a_allowedips[$id] = $ip; } else { $oldip = $ip['ip']; + if (!empty($$ip['sn'])) + $oldip .= "/{$$ip['sn']}"; $a_allowedips[] = $ip; } allowedips_sort(); @@ -169,6 +175,11 @@ include("head.inc"); <td width="22%" valign="top" class="vncellreq"><?=gettext("IP address"); ?></td> <td width="78%" class="vtable"> <?=$mandfldhtml;?><input name="ip" type="text" class="formfld unknown" id="ip" size="17" value="<?=htmlspecialchars($pconfig['ip']);?>"> + <select name='sn' class="formselect" id='sn'> + <?php for ($i = 32; $i >= 1; $i--): ?> + <option value="<?=$i;?>" <?php if ($i == $pconfig['sn']) echo "selected"; ?>><?=$i;?></option> + <?php endfor; ?> + </select> <br> <span class="vexpl"><?=gettext("IP address"); ?></span></td> </tr> diff --git a/usr/local/www/services_rfc2136.php b/usr/local/www/services_rfc2136.php index f0eaabb..563ee26 100644 --- a/usr/local/www/services_rfc2136.php +++ b/usr/local/www/services_rfc2136.php @@ -48,7 +48,7 @@ if ($_GET['act'] == "del") { write_config(); - header("Location: services_dyndns.php"); + header("Location: services_rfc2136.php"); exit; } @@ -105,9 +105,9 @@ include("head.inc"); </tr> <tr> <td colspan="3" class="list"><p class="vexpl"><span class="red"><strong> - <?=gettext("Note");?>:<br> + <br> </strong></span> - <?=gettext("Add something meaningful here.");?> + </td> <td class="list"> </td> </tr> diff --git a/usr/local/www/services_rfc2136_edit.php b/usr/local/www/services_rfc2136_edit.php index 57dfdc6..f195786 100644 --- a/usr/local/www/services_rfc2136_edit.php +++ b/usr/local/www/services_rfc2136_edit.php @@ -81,7 +81,7 @@ if ($_POST) { if (!$input_errors) { $rfc2136 = array(); - $rfc2136['enable'] = $_POST['enable'] ? false : true; + $rfc2136['enable'] = $_POST['enable'] ? true : false; $rfc2136['host'] = $_POST['host']; $rfc2136['ttl'] = $_POST['ttl']; $rfc2136['keyname'] = $_POST['keyname']; diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php index 119be42..50f70d3 100755 --- a/usr/local/www/services_snmp.php +++ b/usr/local/www/services_snmp.php @@ -290,7 +290,7 @@ function enable_change(whichone) { <td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td> <td width="78%" class="vtable"> <input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>"> - <br><?=gettext("In most cases"); ?>, "<?=gettext("public"); ?>" <?=gettext("is used here");?></br> + <br>The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.</br> </td> </tr> diff --git a/usr/local/www/status_gateway_groups.php b/usr/local/www/status_gateway_groups.php index c282d36..f70f539 100755 --- a/usr/local/www/status_gateway_groups.php +++ b/usr/local/www/status_gateway_groups.php @@ -4,7 +4,7 @@ status_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_gateways.php b/usr/local/www/status_gateways.php index e2e5484..eac1b2f 100755 --- a/usr/local/www/status_gateways.php +++ b/usr/local/www/status_gateways.php @@ -4,7 +4,7 @@ status_gateways.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php index 19a7eb2..54f3398 100755 --- a/usr/local/www/status_lb_pool.php +++ b/usr/local/www/status_lb_pool.php @@ -4,7 +4,7 @@ status_lb_pool.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php index 83e7d44..91e89dd 100755 --- a/usr/local/www/status_lb_vs.php +++ b/usr/local/www/status_lb_vs.php @@ -4,7 +4,7 @@ status_lb_vs.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php index a52cc86..2be04dc 100755 --- a/usr/local/www/status_rrd_graph.php +++ b/usr/local/www/status_rrd_graph.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -49,7 +49,9 @@ if(! isset($config['rrd']['enable'])) { } $rrddbpath = "/var/db/rrd/"; -$databases = glob("{$rrddbpath}*.rrd"); +chdir($rrddbpath); +$databases = glob("*.rrd"); + if ($_GET['cat']) { $curcat = $_GET['cat']; @@ -107,12 +109,22 @@ if ($_GET['option']) { continue 2; } } + case "vpnusers": + foreach($databases as $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]"; + continue 2; + } + } default: $curoption = "wan"; break; } } +$now = time(); if($curcat == "custom") { if (is_numeric($_GET['start'])) { if($start < ($now - (3600 * 24 * 365 * 5))) { @@ -155,6 +167,7 @@ $dbheader = array("allgraphs-traffic.rrd", "allgraphs-quality.rrd", "allgraphs-wireless.rrd", "allgraphs-cellular.rrd", + "allgraphs-vpnusers.rrd", "allgraphs-packets.rrd", "system-allgraphs.rrd", "system-throughput.rrd", @@ -163,15 +176,18 @@ $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, "-vpnusers")) { + $vpnusers = true; + } } /* append the existing array to the header */ $ui_databases = array_merge($dbheader, $databases); @@ -190,7 +206,7 @@ function get_dates($curperiod, $graph) { $curyear = date('Y', $now); $curmonth = date('m', $now); $curweek = date('W', $now); - $curweekday = date('w', $now); + $curweekday = date('N', $now) - 1; // We want to start on monday $curday = date('d', $now); switch($curperiod) { @@ -206,8 +222,16 @@ function get_dates($curperiod, $graph) { $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear); break; case "week": - $start = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) - $offset), $curyear); - $end = mktime(0, 0, 0, $curmonth, (($curday + $curweekday) + 7), $curyear); + switch($offset) { + case 0; + $weekoffset = 0; + break; + default: + $weekoffset = ($offset * 7) - 7; + break; + } + $start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear); + $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear); break; case "month": $start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear); @@ -254,9 +278,9 @@ function get_dates($curperiod, $graph) { $tab_array[] = array(gettext("Quality"), $tabactive, "status_rrd_graph.php?cat=quality"); if($queues) { if($curcat == "queues") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues"); + $tab_array[] = array(gettext("Queues"), $tabactive, "status_rrd_graph.php?cat=queues"); if($curcat == "queuedrops") { $tabactive = True; } else { $tabactive = False; } - $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops"); + $tab_array[] = array(gettext("QueueDrops"), $tabactive, "status_rrd_graph.php?cat=queuedrops"); } if($wireless) { if($curcat == "wireless") { $tabactive = True; } else { $tabactive = False; } @@ -266,6 +290,10 @@ function get_dates($curperiod, $graph) { if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("Cellular"), $tabactive, "status_rrd_graph.php?cat=cellular"); } + 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(gettext("Custom"), $tabactive, "status_rrd_graph.php?cat=custom"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } @@ -330,7 +358,6 @@ function get_dates($curperiod, $graph) { echo " selected"; } echo ">" . htmlspecialchars($prettyprint) . "</option>\n"; - } ?> @@ -360,59 +387,73 @@ function get_dates($curperiod, $graph) { } } ?> - </select> - <?php if($curcat == "custom") { - - - } - foreach($graphs as $graph) { - /* check which databases are valid for our category */ - foreach($ui_databases as $curdatabase) { - if(! preg_match("/($curcat)/i", $curdatabase)) { - continue; - } - $optionc = split("-", $curdatabase); - $search = array("-", ".rrd", $optionc); - $replace = array(" :: ", "", $friendly); - switch($curoption) { - case "outbound": - /* only show interfaces with a gateway */ - $optionc = "$optionc[0]"; - if(!interface_has_gateway($optionc)) { - if(!preg_match("/($optionc)-(quality)/", $curdatabase)) { + ?> + <?=gettext("Start:");?> + <input type="text" name="start" class="formfldunknown" length="32" value="<?php echo $start;?>"> + <?=gettext("End:");?> + <input type="text" name="end" class="formfldunknown" length="32" value="<?php echo $now;?>"> + <input type="submit" name="Submit" value="Go"> + <? + $curdatabase = $curoption; + $graph = "custom-$curdatabase"; + if(in_array($curdatabase, $databases)) { + echo "<tr><td colspan=2 class=\"list\">\n"; + echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; + echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; + echo "<br /><hr><br />\n"; + echo "</td></tr>\n"; + } + } else { + foreach($graphs as $graph) { + /* check which databases are valid for our category */ + foreach($ui_databases as $curdatabase) { + if(! preg_match("/($curcat)/i", $curdatabase)) { + continue; + } + $optionc = split("-", $curdatabase); + $search = array("-", ".rrd", $optionc); + $replace = array(" :: ", "", $friendly); + switch($curoption) { + case "outbound": + /* only show interfaces with a gateway */ + $optionc = "$optionc[0]"; + if(!interface_has_gateway($optionc)) { + if(!preg_match("/($optionc)-(quality)/", $curdatabase)) { + continue 2; + } + } + if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { continue 2; } - } - if(! preg_match("/($optionc)[-.]/i", $curdatabase)) { - continue 2; - } - break; - case "allgraphs": - /* make sure we do not show the placeholder databases in the all view */ - if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { - continue 2; - } - break; - default: - /* just use the name here */ - if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { - continue 2; - } - } - if(in_array($curdatabase, $databases)) { - $dates = get_dates($curperiod, $graph); - $start = $dates['start']; - $end = $dates['end']; - echo "<tr><td colspan=2 class=\"list\">\n"; - echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; - echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; - echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; - echo "<br /><hr><br />\n"; - echo "</td></tr>\n"; + break; + case "allgraphs": + /* make sure we do not show the placeholder databases in the all view */ + if((stristr($curdatabase, "outbound")) || (stristr($curdatabase, "allgraphs"))) { + continue 2; + } + break; + default: + /* just use the name here */ + if(! preg_match("/($curoption)[-.]/i", $curdatabase)) { + continue 2; + } + } + if(in_array($curdatabase, $databases)) { + $dates = get_dates($curperiod, $graph); + $start = $dates['start']; + $end = $dates['end']; + echo "<tr><td colspan=2 class=\"list\">\n"; + echo "<IMG BORDER='0' name='{$graph}-{$curoption}-{$curdatabase}' "; + echo "id='{$graph}-{$curoption}-{$curdatabase}' ALT=\"$prettydb Graph\" "; + echo "SRC=\"status_rrd_graph_img.php?start={$start}&end={$end}&database={$curdatabase}&style={$curstyle}&graph={$graph}\" />\n"; + echo "<br /><hr><br />\n"; + echo "</td></tr>\n"; + } } } } diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php index cd93550..bc974b1 100644 --- a/usr/local/www/status_rrd_graph_img.php +++ b/usr/local/www/status_rrd_graph_img.php @@ -3,7 +3,7 @@ /* status_rrd_graph_img.php Part of pfSense - Copyright (C) 2009 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2009 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. */ /* - pfSense_BUILDER_BINARIES: /usr/bin/find /bin/rm /usr/local/bin/rrdtool + pfSense_BUILDER_BINARIES: /bin/rm /usr/local/bin/rrdtool pfSense_MODULE: system */ @@ -40,7 +40,7 @@ require_once("rrd.inc"); $pgtitle = array(gettext("System"),gettext("RRD Graphs"),gettext("Image viewer")); if ($_GET['database']) { - $curdatabase = $_GET['database']; + $curdatabase = basename($_GET['database']); } else { $curdatabase = "wan-traffic.rrd"; } @@ -146,8 +146,9 @@ $havg = timeDiff($average, $defOptions); $hperiod = timeDiff($seconds, $defOptions); $data = true; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +$rrddbpath = "/var/db/rrd/"; +chdir($rrddbpath); +$databases = glob("*.rrd"); rsort($databases); /* compare bytes/sec counters, divide bps by 8 */ @@ -205,6 +206,7 @@ if(file_exists($rrdcolors)) { $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); + $colorvpnusers = array('990000'); } switch ($curstyle) { @@ -570,6 +572,25 @@ elseif((strstr($curdatabase, "-wireless.rrd")) && (file_exists("$rrddbpath$curda $graphcmd .= "COMMENT:\"\\n\" "; $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; } +elseif((strstr($curdatabase, "-vpnusers.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { + /* define graphcmd for vpn users stats */ + $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; + $graphcmd .= "--start $start --end $end "; + $graphcmd .= "--vertical-label \"users\" "; + $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee "; + $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" "; + $graphcmd .= "--height 200 --width 620 "; + $graphcmd .= "DEF:\"$curif-users=$rrddbpath$curdatabase:users:AVERAGE\" "; + $graphcmd .= "LINE2:\"$curif-users#{$colorvpnusers[0]}:$curif-users\" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t maximum\t\t average\t current\\n\" "; + $graphcmd .= "COMMENT:\"Users Online\t\" "; + $graphcmd .= "GPRINT:\"$curif-users:MAX:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:AVERAGE:%7.2lf \" "; + $graphcmd .= "GPRINT:\"$curif-users:LAST:%7.2lf \" "; + $graphcmd .= "COMMENT:\"\\n\" "; + $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" "; +} elseif((strstr($curdatabase, "-states.rrd")) && (file_exists("$rrddbpath$curdatabase"))) { /* define graphcmd for states stats */ $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png "; diff --git a/usr/local/www/status_rrd_graph_settings.php b/usr/local/www/status_rrd_graph_settings.php index 7de6788..7d80ad2 100755 --- a/usr/local/www/status_rrd_graph_settings.php +++ b/usr/local/www/status_rrd_graph_settings.php @@ -3,7 +3,7 @@ /* status_rrd_graph.php Part of pfSense - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl> + Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> All rights reserved. Redistribution and use in source and binary forms, with or without @@ -77,9 +77,11 @@ if ($_POST) { } } + + $rrddbpath = "/var/db/rrd/"; -/* XXX: (billm) do we have an exec() type function that does this type of thing? */ -exec("cd $rrddbpath;/usr/bin/find -name *.rrd", $databases); +chdir($rrddbpath); +$databases = glob("*.rrd"); foreach($databases as $database) { if(stristr($database, "wireless")) { @@ -91,6 +93,9 @@ foreach($databases as $database) { if(stristr($database, "cellular")) { $cellular = true; } + if(stristr($database, "-vpnusers")) { + $vpnusers = true; + } } $pgtitle = array(gettext("Status"),gettext("RRD Graphs")); @@ -106,6 +111,7 @@ include("head.inc"); <tr> <td> <?php +<<<<<<< HEAD $tab_array = array(); if($curcat == "system") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("System"), $tabactive, "status_rrd_graph.php?cat=system"); @@ -132,6 +138,39 @@ include("head.inc"); if($curcat == "settings") { $tabactive = True; } else { $tabactive = False; } $tab_array[] = array(gettext("Settings"), $tabactive, "status_rrd_graph_settings.php"); display_top_tabs($tab_array); + $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 == "queuedrops") { $tabactive = True; } else { $tabactive = False; } + $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($cellular) { + if($curcat == "cellular") { $tabactive = True; } else { $tabactive = False; } + $tab_array[] = array("Cellular", $tabactive, "status_rrd_graph.php?cat=cellular"); + } + 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> diff --git a/usr/local/www/status_upnp.php b/usr/local/www/status_upnp.php index d2e0a88..7197a2c 100644 --- a/usr/local/www/status_upnp.php +++ b/usr/local/www/status_upnp.php @@ -4,7 +4,7 @@ status_upnp.php part of pfSense (http://www.pfsense.com/) - Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups.php b/usr/local/www/system_gateway_groups.php index 43dfea7..f767aff 100755 --- a/usr/local/www/system_gateway_groups.php +++ b/usr/local/www/system_gateway_groups.php @@ -4,7 +4,7 @@ system_gateway_groups.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php index 1a504c5..268a5da 100755 --- a/usr/local/www/system_gateway_groups_edit.php +++ b/usr/local/www/system_gateway_groups_edit.php @@ -4,7 +4,7 @@ system_gateway_groups_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways.php b/usr/local/www/system_gateways.php index 82004a7..d789d76 100755 --- a/usr/local/www/system_gateways.php +++ b/usr/local/www/system_gateways.php @@ -4,7 +4,7 @@ system_gateways.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 98d1e81..e679b90 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -4,7 +4,7 @@ system_gateways_edit.php part of pfSense (http://pfsense.com) - Copyright (C) 2007 Seth Mos <seth.mos@xs4all.nl>. + Copyright (C) 2010 Seth Mos <seth.mos@dds.nl>. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/usr/local/www/themes/code-red/rrdcolors.inc.php b/usr/local/www/themes/code-red/rrdcolors.inc.php index cbd6a8d..1ab0fd0 100755 --- a/usr/local/www/themes/code-red/rrdcolors.inc.php +++ b/usr/local/www/themes/code-red/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('990000','a83c3c','b36666');
$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
?>
diff --git a/usr/local/www/themes/metallic/rrdcolors.inc.php b/usr/local/www/themes/metallic/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/metallic/rrdcolors.inc.php +++ b/usr/local/www/themes/metallic/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/nervecenter/rrdcolors.inc.php b/usr/local/www/themes/nervecenter/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/nervecenter/rrdcolors.inc.php +++ b/usr/local/www/themes/nervecenter/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense-dropdown/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense/rrdcolors.inc.php b/usr/local/www/themes/pfsense/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php +++ b/usr/local/www/themes/pfsense_ng/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> diff --git a/usr/local/www/themes/the_wall/rrdcolors.inc.php b/usr/local/www/themes/the_wall/rrdcolors.inc.php index e3153fd..8e74545 100644 --- a/usr/local/www/themes/the_wall/rrdcolors.inc.php +++ b/usr/local/www/themes/the_wall/rrdcolors.inc.php @@ -46,5 +46,6 @@ $colorqualityloss = "ee0000"; $colorwireless = array('333333','a83c3c','999999'); $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066'); $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600'); +$colorvpnusers = array('990000'); ?> |