diff options
Diffstat (limited to 'packages/squidGuard/squidguard.inc')
-rw-r--r-- | packages/squidGuard/squidguard.inc | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/packages/squidGuard/squidguard.inc b/packages/squidGuard/squidguard.inc index f7866965..63663aaf 100644 --- a/packages/squidGuard/squidguard.inc +++ b/packages/squidGuard/squidguard.inc @@ -332,21 +332,31 @@ function squidguard_validate_rewrite($post, $input_errors) { // squidguard_resync // ----------------------------------------------------------------------------- function squidguard_resync() { - $conf = ''; - $upload_file = ''; - - // blacklist upload - if ($_POST['submit'] == BLACKLIST_BTN_URL) { - // upload from another url - $url = $_POST['blacklist_url']; - $proxy = $_POST['blacklist_proxy']; - if ($url) - sg_reconfigure_blacklist($url, $proxy); - } - // apply changes - if ($_POST['submit'] == APPLY_BTN) sg_reconfigure(); + global $config; + $conf = $config['installedpackages'][MODULE_GENERAL]['config'][0]; + $upload_file = ''; + $submit = ''; + + if (isset($_POST['submit'])) + $submit = $_POST['submit']; + else + if (isset($_GET['submit'])) + $submit = $_GET['submit']; + + // blacklist upload + if ($submit == BLACKLIST_BTN_URL) { +# $url = $_POST['blacklist_url']; +# $proxy = $_POST['blacklist_proxy']; + $url = $conf['blacklist_url']; + $proxy = $conf['blacklist_proxy']; + if ($url) + sg_reconfigure_blacklist($url, $proxy); + } + // apply changes + if ($submit == APPLY_BTN) sg_reconfigure(); } + // ----------------------------------------------------------------------------- // squidguard_resync_acl // ----------------------------------------------------------------------------- |