Bug #4088 » squidguard_configurator.inc.diff
/usr/local/pkg/squidguard_configurator.inc 2014-06-03 00:30:48.000000000 +1200 | ||
---|---|---|
889 | 889 |
} |
890 | 890 | |
891 | 891 |
# --- Sources --- |
892 |
#$sgconf[] = "# # src begin"; |
|
892 | 893 |
if ($squidguard_config[F_SOURCES]) { |
893 | 894 |
$temp_str = ''; |
894 | 895 |
foreach($squidguard_config[F_SOURCES][F_ITEM] as $src) { |
896 |
# Don't write out the source if the ACL is disabled! |
|
897 |
# (Squidguard 1.4 treats the source as "always pass" otherwise!) |
|
898 |
$acl_disabled = 0; |
|
899 |
foreach($squidguard_config[F_ACLS][F_ITEM] as $acl) { |
|
900 |
if ($acl[F_NAME] == $src[F_NAME]) { |
|
901 |
if ($acl[F_DISABLED]) { |
|
902 |
$acl_disabled = 1; |
|
903 |
} |
|
904 |
break; |
|
905 |
} |
|
906 |
} |
|
907 |
if (!$acl_disabled) { |
|
895 | 908 |
$sg_tag->clear(); |
896 | 909 |
$sg_tag->set("src", $src[F_NAME], "", $src[F_DESCRIPTION]); |
897 | 910 | |
... | ... | |
918 | 931 | |
919 | 932 |
# log |
920 | 933 |
$temp_str .= " " . $src[F_NAME]; |
934 |
} |
|
921 | 935 |
} |
922 | 936 |
# log |
923 | 937 |
$temp_str = !empty($temp_str) ? $temp_str : "Nothing."; |
924 | 938 |
sg_addlog("sg_create_config", "Add sources: $temp_str", SQUIDGUARD_INFO); |
925 | 939 |
} |
940 |
#$sgconf[] = "# # src end"; |
|
926 | 941 | |
927 | 942 |
# --- Blacklist --- |
928 | 943 |
# Note! Blacklist must be added to config permanently. It's need for rebuild DB now |
... | ... | |
1091 | 1106 |
$sg_acltag->items[] = "redirect " . sg_redirector_base_url($acl[F_REDIRECT], $acl[F_RMOD]); |
1092 | 1107 |
if ($acl[F_REWRITENAME]) |
1093 | 1108 |
$sg_acltag->items[] = "rewrite {$acl[F_REWRITENAME]}"; |
1094 |
if ($squidguard_config[F_ENABLELOG] == 'on' ) { |
|
1095 |
if ($acl[F_LOG]) |
|
1096 |
$sg_acltag->items[] = "log " . SQUIDGUARD_LOGFILE; |
|
1097 |
} |
|
1109 |
# Squidguard 1.4 doesn't allow a log statement here. |
|
1110 |
#if ($squidguard_config[F_ENABLELOG] == 'on' ) { |
|
1111 |
# if ($acl[F_LOG]) |
|
1112 |
# $sg_acltag->items[] = "log " . SQUIDGUARD_LOGFILE; |
|
1113 |
#} |
|
1098 | 1114 | |
1099 | 1115 |
# overtime |
1100 | 1116 |
if ($acl[F_TIMENAME]) { |