aboutsummaryrefslogtreecommitdiffstats
path: root/config/squidGuard
diff options
context:
space:
mode:
Diffstat (limited to 'config/squidGuard')
-rw-r--r--config/squidGuard/squidguard.inc4
-rw-r--r--config/squidGuard/squidguard_configurator.inc24
2 files changed, 16 insertions, 12 deletions
diff --git a/config/squidGuard/squidguard.inc b/config/squidGuard/squidguard.inc
index 8007e302..d0e1213a 100644
--- a/config/squidGuard/squidguard.inc
+++ b/config/squidGuard/squidguard.inc
@@ -316,11 +316,11 @@ function squidguard_resync() {
}
# apply changes
- if ($submit == APPLY_BTN) {
+ //if ($submit == APPLY_BTN) {
# write_config('Update squidGuard options.'); # store, if not 'Save' button
# перенести в validate для детектирования ошибок?
sg_reconfigure();
- }
+ //}
}
# -----------------------------------------------------------------------------
diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc
index 73f935bc..afc6d23a 100644
--- a/config/squidGuard/squidguard_configurator.inc
+++ b/config/squidGuard/squidguard_configurator.inc
@@ -1193,16 +1193,18 @@ function sg_check_config_data ($input_errors)
}
# --- Blacklist ---
- $blk_entries_file = $squidguard_config[F_WORKDIR] . SQUIDGUARD_BLK_ENTRIES;
- if (file_exists($blk_entries_file)) {
- $blk_entr = explode("\n", file_get_contents($blk_entries_file));
- foreach($blk_entr as $entr) {
- if ($entr) {
- $destinations[] = $entr;
- # check entry for exists
- $dbfile = $squidguard_config[F_DBHOME] . "/$entr";
- if (!file_exists($dbfile))
- $elog[] = "(B1) BLACKLIST '$entr' error: file '$dbfile' not found";
+ if ($squidguard_config[F_BLACKLISTENABLED]) {
+ $blk_entries_file = $squidguard_config[F_WORKDIR] . SQUIDGUARD_BLK_ENTRIES;
+ if (file_exists($blk_entries_file)) {
+ $blk_entr = explode("\n", file_get_contents($blk_entries_file));
+ foreach($blk_entr as $entr) {
+ if ($entr) {
+ $destinations[] = $entr;
+ # check entry for exists
+ $dbfile = $squidguard_config[F_DBHOME] . "/$entr";
+ if (!file_exists($dbfile))
+ $elog[] = "(B1) BLACKLIST '$entr' error: file '$dbfile' not found";
+ }
}
}
}
@@ -2057,6 +2059,8 @@ function acl_remove_blacklist_items($items)
{
# add !items and ^items
$db_entries = sg_entries_blacklist();
+ if (!is_array($db_entries))
+ return;
$tdb_entries = array();
foreach ($db_entries as $ent) {
$tdb_entries[] = $ent;