518 |
518 |
# sg_reconfigure_user_db - reconfigure(update) db user entries
|
519 |
519 |
# ------------------------------------------------------------------------------
|
520 |
520 |
function sg_reconfigure_user_db() {
|
521 |
|
global $squidguard_config;
|
|
521 |
global $squidguard_config, $config;
|
522 |
522 |
$dbhome = $squidguard_config[F_DBHOME];
|
523 |
523 |
|
524 |
524 |
sg_addlog("sg_reconfigure_user_db", "Begin with '$dbhome'", SQUIDGUARD_INFO);
|
... | ... | |
533 |
533 |
sg_addlog("sg_reconfigure_user_db", "Create user DB directory '$dbhome'.", SQUIDGUARD_INFO);
|
534 |
534 |
}
|
535 |
535 |
|
|
536 |
/* bypass local IPs for squid_status.php, see https://redmine.pfsense.org/issues/11711 */
|
|
537 |
if ($squidguard_config[F_DEFAULT][F_NOTALLOWINGIP]) {
|
|
538 |
init_config_arr(array('installedpackages', 'squidcache','config'));
|
|
539 |
$proxy_ifaces = explode(",", $config['installedpackages']['squid']['config'][0]['active_interface']);
|
|
540 |
$sgips = '';
|
|
541 |
foreach ($proxy_ifaces as $iface) {
|
|
542 |
if (get_interface_ip($iface)) {
|
|
543 |
$sgips .= get_interface_ip($iface) . ' ';
|
|
544 |
} else {
|
|
545 |
$sgips .= get_interface_ipv6($iface) . ' ';
|
|
546 |
}
|
|
547 |
}
|
|
548 |
if (!empty($sgips)) {
|
|
549 |
$squidguard_config[F_DESTINATIONS][F_ITEM][] = array(F_NAME => 'squidstatus',
|
|
550 |
F_DOMAINS => $sgips, F_RMOD => RMOD_NONE);
|
|
551 |
}
|
|
552 |
}
|
|
553 |
|
536 |
554 |
# update destinations to db
|
537 |
555 |
$dests = $squidguard_config[F_DESTINATIONS];
|
538 |
556 |
if (!empty($dests)) {
|
... | ... | |
1106 |
1124 |
|
1107 |
1125 |
# not allowing IP in URL
|
1108 |
1126 |
if ($acl[F_NOTALLOWINGIP]) {
|
1109 |
|
$acl[F_DESTINATIONNAME] = "!in-addr {$acl[F_DESTINATIONNAME]}";
|
1110 |
|
$acl[F_OVERDESTINATIONNAME] = "!in-addr {$acl[F_OVERDESTINATIONNAME]}";
|
|
1127 |
$acl[F_DESTINATIONNAME] = "^squidstatus !in-addr {$acl[F_DESTINATIONNAME]}";
|
|
1128 |
$acl[F_OVERDESTINATIONNAME] = "^squidstatus !in-addr {$acl[F_OVERDESTINATIONNAME]}";
|
1111 |
1129 |
}
|
1112 |
1130 |
|
1113 |
1131 |
# re-order acl pass (<white><!in-addr><deny><allow><all|none>)
|
... | ... | |
1164 |
1182 |
|
1165 |
1183 |
# not allowing IP in URL
|
1166 |
1184 |
if ($def[F_NOTALLOWINGIP]) {
|
1167 |
|
$def[F_DESTINATIONNAME] = "!in-addr " . $def[F_DESTINATIONNAME];
|
|
1185 |
$def[F_DESTINATIONNAME] = "^squidstatus !in-addr " . $def[F_DESTINATIONNAME];
|
1168 |
1186 |
}
|
1169 |
1187 |
|
1170 |
1188 |
# re-order acl pass (<allow><deny<all|none>)
|