From 60c8e388e48b01a293a9f3f2d9efbcf5688dc271 Mon Sep 17 00:00:00 2001 From: "D. V. Serg" Date: Mon, 21 Jan 2008 19:54:42 +0000 Subject: Blacklist update --- packages/squidGuard/squidguard.inc | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'packages/squidGuard/squidguard.inc') 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 // ----------------------------------------------------------------------------- -- cgit v1.2.3