aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-03-30 19:15:10 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-03-30 19:15:10 -0300
commit7852acc1ede90c850669e6d94568c53c5fb807d4 (patch)
tree69f7080a5545158c8f081369f23440bee1416e20
parent3998c049f38f3dc0d0e27bdc39631264b3d1f6d8 (diff)
downloadpfsense-packages-7852acc1ede90c850669e6d94568c53c5fb807d4.tar.gz
pfsense-packages-7852acc1ede90c850669e6d94568c53c5fb807d4.tar.bz2
pfsense-packages-7852acc1ede90c850669e6d94568c53c5fb807d4.zip
sarg - version 0.2.1 with report tab cache fix
-rw-r--r--config/sarg/sarg.inc3
-rw-r--r--config/sarg/sarg.template3
-rw-r--r--config/sarg/sarg.xml7
-rwxr-xr-xconfig/sarg/sarg_frame.php59
-rwxr-xr-xconfig/sarg/sarg_queue.php5
-rwxr-xr-xconfig/sarg/sarg_realtime.php9
-rwxr-xr-xconfig/sarg/sarg_reports.php7
-rw-r--r--pkg_config.8.xml2
-rw-r--r--pkg_config.8.xml.amd642
9 files changed, 78 insertions, 19 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index 4194be64..c21d700d 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -119,7 +119,7 @@ function sync_package_sarg() {
#mount filesystem writeable
conf_mount_rw();
if (!is_array($config['installedpackages']['sarg']['config']))
- $config['installedpackages']['sarg']['config'][0]=array('report_options'=>'use_graphs,remove_temp_files,main_index,use_comma,overwrite_report',
+ $config['installedpackages']['sarg']['config'][0]=array('report_options'=>'use_graphs,remove_temp_files,main_index,use_comma',
'user_sort_field'=>'BYTES',
'report_type'=>'topusers,topsites,sites_users,users_sites,date_time,denied,auth_failures,site_user_time_date,downloads');
$sarg=$config['installedpackages']['sarg']['config'][0];
@@ -157,7 +157,6 @@ function sync_package_sarg() {
include("/usr/local/pkg/sarg.template");
file_put_contents("/usr/local/etc/sarg/sarg.conf", $sg, LOCK_EX);
-
file_put_contents('/usr/local/etc/sarg/exclude_users.conf', sarg_text_area_decode($sarg['exclude_userlist']),LOCK_EX);
file_put_contents('/usr/local/etc/sarg/exclude_hosts.conf', sarg_text_area_decode($sarg['exclude_hostlist']),LOCK_EX);
file_put_contents('/usr/local/etc/sarg/exclude_codes.conf', sarg_text_area_decode($sarg['exclude_codelist']),LOCK_EX);
diff --git a/config/sarg/sarg.template b/config/sarg/sarg.template
index 024d6d5c..b5676834 100644
--- a/config/sarg/sarg.template
+++ b/config/sarg/sarg.template
@@ -1,6 +1,6 @@
<?php
/*
- sag.conf.template
+ sag.template
part of the Dansguardian package for pfSense
Copyright (C) 2012 Marcello Coutinho
All rights reserved.
@@ -683,7 +683,6 @@ www_document_root /usr/local/www
# it to your liking.
#
#external_css_file none
-
# TAG: user_authentication yes|no
# Allow user authentication in User Reports using .htaccess
# Parameters:
diff --git a/config/sarg/sarg.xml b/config/sarg/sarg.xml
index 98acc20f..aff3e7ff 100644
--- a/config/sarg/sarg.xml
+++ b/config/sarg/sarg.xml
@@ -99,6 +99,11 @@
<chmod>0755</chmod>
</additional_files_needed>
<additional_files_needed>
+ <item>http://www.pfsense.org/packages/config/sarg/sarg_frame.php</item>
+ <prefix>/usr/local/www/</prefix>
+ <chmod>0755</chmod>
+ </additional_files_needed>
+ <additional_files_needed>
<item>http://www.pfsense.org/packages/config/sarg/sarg.template</item>
<prefix>/usr/local/pkg/</prefix>
<chmod>0755</chmod>
@@ -162,7 +167,7 @@
<option><name>Remove temporary files from root report directory (yes)</name><value>remove_temp_files</value></option>
<option><name>Generate the main index.html (yes)</name><value>main_index</value></option>
<option><name>Generate the index tree by file (on)</name><value>index_tree</value></option>
- <option><name>Overwrite report (yes)</name><value>overwrite_report</value></option>
+ <option><name>Overwrite report (no)</name><value>overwrite_report</value></option>
<option><name>Use comma instead point in reports (yes)</name><value>use_comma</value></option>
<option><name>Show full url in report (no)</name><value>long_url</value></option>
<option><name>Privacy (no)</name><value>privacy</value></option>
diff --git a/config/sarg/sarg_frame.php b/config/sarg/sarg_frame.php
new file mode 100755
index 00000000..96b8c92f
--- /dev/null
+++ b/config/sarg/sarg_frame.php
@@ -0,0 +1,59 @@
+<?php
+/*
+ sarg_frame.php
+ part of pfSense (http://www.pfsense.com/)
+ Copyright (C) 2012 Marcello Coutinho <marcellocoutinho@gmail.com>
+ based on varnish_view_config.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+if(preg_match("/(\S+)\W(\w+.html)/",$_REQUEST['file'],$matches)){
+ #https://192.168.1.1/sarg_reports.php?file=2012Mar30-2012Mar30/index.html
+ $url=$matches[2];
+ $prefix=$matches[1];
+ }
+else{
+ $url="index.html";
+ $prefix="";
+ }
+$url=($_REQUEST['file'] == ""?"index.html":$_REQUEST['file']);
+$report=file_get_contents("/usr/local/www/sarg-reports/".$url);
+/*$pattern[0]="/header_\w/";
+$replace[0]="listtopic";
+$pattern[1]="/class=.data./";
+$replace[1]='class="listlr"';
+$pattern[2]="/cellpadding=.\d./";
+$replace[2]='cellpadding="0"';
+$pattern[3]="/cellspacing=.\d./";
+$replace[3]='cellspacing="0"';
+$pattern[4]="/sarg/";
+$replace[4]='cellspacing="0"';
+*/
+$pattern[0]="/href=\W(\S+html)\W/";
+$replace[0]="href=/sarg_frame.php?file=$prefix/$1";
+$pattern[1]='/img src="(\w+\.\w+)/';
+$replace[1]='img src="/sarg-reports'.$prefix.'/$1';
+
+print preg_replace($pattern,$replace,$report);
+?> \ No newline at end of file
diff --git a/config/sarg/sarg_queue.php b/config/sarg/sarg_queue.php
index 627c06eb..8b8329a5 100755
--- a/config/sarg/sarg_queue.php
+++ b/config/sarg/sarg_queue.php
@@ -1,9 +1,8 @@
<?php
/*
- postfix_view_config.php
+ sarg_queue.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2011 Marcello Coutinho <marcellocoutinho@gmail.com>
- based on varnish_view_config.
+ Copyright (C) 2012 Marcello Coutinho <marcellocoutinho@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/config/sarg/sarg_realtime.php b/config/sarg/sarg_realtime.php
index 1af3eb70..ced24376 100755
--- a/config/sarg/sarg_realtime.php
+++ b/config/sarg/sarg_realtime.php
@@ -1,9 +1,8 @@
<?php
/*
- postfix_view_config.php
+ sarg_realtime.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2011 Marcello Coutinho <marcellocoutinho@gmail.com>
- based on varnish_view_config.
+ Copyright (C) 2012 Marcello Coutinho <marcellocoutinho@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -133,7 +132,7 @@ else{
<td width="78%" class="vtable">
<select name="drop3" id="cmd">
<option value="sarg" selected="selected">Sarg Realtime</option>
- </select><br><?=gettext("Select queue command to run.");?></td>
+ </select><br><?=gettext("Select report command to run.");?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("update frequency: ");?></td>
@@ -146,7 +145,7 @@ else{
<option value="30">30 Seconds</option>
<option value="60">One minute</option>
<option value="1">Never</option>
- </select><br><?=gettext("Select how often queue cmd will run.");?></td>
+ </select><br><?=gettext("Select how often report will run.");?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Report Types: ");?></td>
diff --git a/config/sarg/sarg_reports.php b/config/sarg/sarg_reports.php
index cf013879..9eee5302 100755
--- a/config/sarg/sarg_reports.php
+++ b/config/sarg/sarg_reports.php
@@ -1,9 +1,8 @@
<?php
/*
- postfix_view_config.php
+ sarg_reports.php
part of pfSense (http://www.pfsense.com/)
- Copyright (C) 2011 Marcello Coutinho <marcellocoutinho@gmail.com>
- based on varnish_view_config.
+ Copyright (C) 2012 Marcello Coutinho <marcellocoutinho@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -130,7 +129,7 @@ else{
</table>
</div>
<br>
- <iframe src="/sarg-reports/" frameborder=0 width="100%" height="600"></iframe>
+ <iframe src="/sarg_frame.php/" frameborder=0 width="100%" height="600"></iframe>
<div id="file_div"></div>
</td>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index a929a3a3..4e63439b 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -552,7 +552,7 @@
<pkginfolink>http://forum.pfsense.org/index.php/topic,47765.0.html</pkginfolink>
<depends_on_package_base_url>http://e-sac.siteseguro.ws/packages/8/All/</depends_on_package_base_url>
<depends_on_package>sarg-2.3.2.tbz</depends_on_package>
- <version>2.3.2 pkg v.0.2</version>
+ <version>2.3.2 pkg v.0.2.1</version>
<status>beta</status>
<required_version>2.0</required_version>
<configurationfile>sarg.xml</configurationfile>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 0a9aca67..35f04e05 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -642,7 +642,7 @@
<pkginfolink>http://forum.pfsense.org/index.php/topic,47765.0.html</pkginfolink>
<depends_on_package_base_url>http://e-sac.siteseguro.ws/packages/amd64/8/All/</depends_on_package_base_url>
<depends_on_package>sarg-2.3.2.tbz</depends_on_package>
- <version>2.3.2 pkg v.0.2</version>
+ <version>2.3.2 pkg v.0.2.1</version>
<status>beta</status>
<required_version>2.0</required_version>
<configurationfile>sarg.xml</configurationfile>