diff options
Diffstat (limited to 'config/lightsquid')
-rw-r--r-- | config/lightsquid/lightsquid.inc | 19 | ||||
-rw-r--r-- | config/lightsquid/sqstat.php | 6 |
2 files changed, 12 insertions, 13 deletions
diff --git a/config/lightsquid/lightsquid.inc b/config/lightsquid/lightsquid.inc index 5fd89470..4b31bc30 100644 --- a/config/lightsquid/lightsquid.inc +++ b/config/lightsquid/lightsquid.inc @@ -294,16 +294,15 @@ function lightsquid_resync() { $ifmgr = $ifmgr . $realif[0] . ";"; } - # ? delete ? - $config['installedpackages']['squidcache']['config'][0]['ext_cachemanager'] = $ifmgr; - # now right - $config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'] = $ifmgr; - - write_config(); - if (function_exists('squid_resync')) { - squid_resync(); - } - else update_log("Function 'squid_resync' not found."); + /* Only save and resync if we're actually making any changes. */ + if (strpos($config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'], $ifmgr) === FALSE) { + $config['installedpackages']['squidnac']['config'][0]['ext_cachemanager'] = $ifmgr; + write_config(); + if (function_exists('squid_resync')) + squid_resync(); + else + update_log("Function 'squid_resync' not found."); + } } } diff --git a/config/lightsquid/sqstat.php b/config/lightsquid/sqstat.php index a56b604a..7b12b970 100644 --- a/config/lightsquid/sqstat.php +++ b/config/lightsquid/sqstat.php @@ -61,7 +61,7 @@ if ($_REQUEST['getactivity']) $pgtitle = "Proxy Squid: Realtime stat (sqstat)"; require_once("head.inc"); - +$csrf_token= csrf_get_tokens(); ?> <link href="sqstat.css" rel="stylesheet" type="text/css"/> @@ -79,7 +79,7 @@ function el(id) { function getactivity(action) { var url = "<?php echo ($_SERVER["PHP_SELF"]); ?>"; - var pars = "getactivity=yes"; + var pars = "getactivity=yes" + "<? echo '&__csrf_magic='.$csrf_token ?>"; var myAjax = new Ajax.Request( url, { @@ -414,4 +414,4 @@ function sqstat_get_real_interface_address($iface) return array($ip, long2ip(hexdec($netmask))); } -?>
\ No newline at end of file +?> |