aboutsummaryrefslogtreecommitdiffstats
path: root/config/sarg/sarg.inc
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-04-03 11:30:45 -0300
committerMarcello Coutinho <marcellocoutinho@gmail.com>2012-04-03 11:30:45 -0300
commit696e201450f9ca8de457df305b30c4766bf13712 (patch)
treeaccc4c07c29813356da50db4804d913d5bf9d225 /config/sarg/sarg.inc
parent0737b58f4d8a8d676342bd6cc9757d167f6dcbb9 (diff)
downloadpfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.tar.gz
pfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.tar.bz2
pfsense-packages-696e201450f9ca8de457df305b30c4766bf13712.zip
sarg - fix images on report and improve file tests
Diffstat (limited to 'config/sarg/sarg.inc')
-rw-r--r--config/sarg/sarg.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index c21d700d..3d04ce15 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -133,12 +133,20 @@ function sync_package_sarg() {
break;
case 'squid':
$access_log='/var/squid/logs/access.log';
+ if (is_array($config['installedpackages']['squid']['config']))
+ if (file_exists($config['installedpackages']['squid']['config'][0]['log_dir']. '/access.log'))
+ $access_log = $config['installedpackages']['squid']['config'][0]['log_dir']. '/access.log';
break;
case 'squidguard':
$access_log='/var/squid/logs/access.log';
break;
}
-
+ if (!file_exists($access_log)){
+ $error="Sarg config error: ".$sarg['proxy_server']." log file ($access_log) does not exists";
+ log_error($error);
+ file_notice("Sarg", $error, "Sarg Settings", "");
+ }
+
$graphs=(preg_match('/use_graphs/',$sarg['report_options'])?"yes":"no");
$anonymous_output_files=(preg_match('/anonymous_output_files/',$sarg['report_options'])?"yes":"no");
$resolve_ip=(preg_match('/resolve_ip/',$sarg['report_options'])?"yes":"no");