Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow an empty Config::$include_ips array to show all IPs (feedback f…

…rom Stephen Vigus on pmacct mailing list)
  • Loading branch information...
commit e76d6c74d04ea68b9c81be09ee5a44171b3d8a53 1 parent 01cf97a
@Daniel15 authored
Showing with 4 additions and 3 deletions.
  1. +2 −1  includes/config.php
  2. +2 −2 includes/data/summary.php
View
3  includes/config.php
@@ -11,7 +11,8 @@ class Config
'prefix' => 'acct_v7_',
);
- // IPs to include in the charts
+ // IPs to include in the statistics
+ // Set this to a blank array to show all IPs
static $include_ips = array(
'66.232.109.156', '66.232.109.157', '66.232.109.158', '66.232.109.159', '66.232.109.160',
'66.232.109.161', '66.232.109.162', '66.232.109.163', '66.232.109.164', '66.232.109.165',
View
4 includes/data/summary.php
@@ -62,7 +62,7 @@ private static function summary($start_date, $end_date)
while ($row = $query->fetchObject())
{
// Check if this IP is on the list of IPs that should be shown
- if (!in_array($row->ip, Config::$include_ips))
+ if (!empty(Config::$include_ips) && !in_array($row->ip, Config::$include_ips))
continue;
$row->bytes_total = $row->bytes_in + $row->bytes_out;
@@ -113,7 +113,7 @@ public static function month_by_day($start_date)
while ($row = $query->fetchObject())
{
// Check if this IP is on the list of IPs that should be shown
- if (!in_array($row->ip, Config::$include_ips))
+ if (!empty(Config::$include_ips) && !in_array($row->ip, Config::$include_ips))
continue;
// Does this host have a data entry yet?
Please sign in to comment.
Something went wrong with that request. Please try again.