aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-04-12 15:25:21 -0300
committermarcelloc <marcellocoutinho@gmail.com>2012-04-12 15:25:21 -0300
commitefc6d927072dc2c696704934116e5da7c347e3b6 (patch)
treec6d5b09c50eba61a38d50ffc0e19f59f3fa2040b
parent40b25d0aa0a963560bba1a00c2eb1589e1f09df9 (diff)
downloadpfsense-packages-efc6d927072dc2c696704934116e5da7c347e3b6.tar.gz
pfsense-packages-efc6d927072dc2c696704934116e5da7c347e3b6.tar.bz2
pfsense-packages-efc6d927072dc2c696704934116e5da7c347e3b6.zip
sarg - include more anti-cache code for reports
-rw-r--r--config/sarg/sarg.inc2
-rwxr-xr-xconfig/sarg/sarg_frame.php2
-rwxr-xr-xconfig/sarg/sarg_reports.php6
3 files changed, 7 insertions, 3 deletions
diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc
index 67deac9c..f2999ceb 100644
--- a/config/sarg/sarg.inc
+++ b/config/sarg/sarg.inc
@@ -81,7 +81,7 @@ function run_sarg($id=-1) {
#mount filesystem writeable
conf_mount_rw();
$cmd = "/usr/local/bin/sarg";
- if ($id > 0 && is_array($config['installedpackages']['sargschedule']['config'])){
+ if ($id >= 0 && is_array($config['installedpackages']['sargschedule']['config'])){
$args=$config['installedpackages']['sargschedule']['config'][$id]['args'];
$action=$config['installedpackages']['sargschedule']['config'][$id]['action'];
}
diff --git a/config/sarg/sarg_frame.php b/config/sarg/sarg_frame.php
index c73b720a..73e3a469 100755
--- a/config/sarg/sarg_frame.php
+++ b/config/sarg/sarg_frame.php
@@ -42,7 +42,7 @@ if (file_exists("/usr/local/www/sarg-reports/".$url))
{
$report=file_get_contents("/usr/local/www/sarg-reports/".$url);
$pattern[0]="/href=\W(\S+html)\W/";
- $replace[0]="href=/sarg_frame.php?file=$prefix/$1";
+ $replace[0]="href=/sarg_frame.php?prevent=".rand(100000000000,999999999999)."&file=$prefix/$1";
$pattern[1]='/img src="(\w+\.\w+)/';
$replace[1]='img src="/sarg-reports'.$prefix.'/$1';
$pattern[2]='@img src="([.a-z/]+)/(\w+\.\w+)@';
diff --git a/config/sarg/sarg_reports.php b/config/sarg/sarg_reports.php
index 170ce478..b64e9966 100755
--- a/config/sarg/sarg_reports.php
+++ b/config/sarg/sarg_reports.php
@@ -73,7 +73,11 @@ require("guiconfig.inc");
</table>
</div>
<br>
- <iframe src="/sarg_frame.php" frameborder=0 width="100%" height="600"></iframe>
+ <script language="JavaScript">
+ var axel = Math.random() + "";
+ var num = axel * 1000000000000000000;
+ document.writeln('<IFRAME SRC="/sarg_frame.php?prevent='+ num +'?" frameborder=0 width="100%" height="600"></IFRAME>');
+ </script>
<div id="file_div"></div>
</td>