aboutsummaryrefslogtreecommitdiffstats
path: root/config/squid-reverse/squid.inc
diff options
context:
space:
mode:
authorMartin Fuchs <martin.fuchs@trendchiller.com>2011-09-30 14:58:45 +0200
committerMartin Fuchs <martin.fuchs@trendchiller.com>2011-09-30 14:58:45 +0200
commit8d2bcb1c7668ce8533f87289795646e47b90cb4b (patch)
treeb5f8ed2288a1bd42a56b79e683c7ff7684155202 /config/squid-reverse/squid.inc
parentce2735901deac81ac11f675224dd01c531b1a3df (diff)
downloadpfsense-packages-8d2bcb1c7668ce8533f87289795646e47b90cb4b.tar.gz
pfsense-packages-8d2bcb1c7668ce8533f87289795646e47b90cb4b.tar.bz2
pfsense-packages-8d2bcb1c7668ce8533f87289795646e47b90cb4b.zip
add some checks
Diffstat (limited to 'config/squid-reverse/squid.inc')
-rw-r--r--config/squid-reverse/squid.inc29
1 files changed, 15 insertions, 14 deletions
diff --git a/config/squid-reverse/squid.inc b/config/squid-reverse/squid.inc
index 03b60f30..7e6acd3a 100644
--- a/config/squid-reverse/squid.inc
+++ b/config/squid-reverse/squid.inc
@@ -1011,11 +1011,12 @@ function squid_resync_reverse() {
$defs = explode("\r\n", ($contents));
foreach ($defs as $def) {
$cfg = explode(";",($def));
- $conf .= "cache_peer {$cfg[1]} parent {$cfg[2]} 0 proxy-only no-query originserver ";
- if($cfg[3] == 'HTTPS')
- $conf .= "login=PASS ssl sslflags=DONT_VERIFY_PEER front-end-https=auto ";
- $conf .= "name={$cfg[0]}\n";
- }}
+ if (($cfg[0]) != '' && ($cfg[1]) != '' && ($cfg[2]) != ''){
+ $conf .= "cache_peer {$cfg[1]} parent {$cfg[2]} 0 proxy-only no-query originserver ";
+ if($cfg[3] == 'HTTPS')
+ $conf .= "login=PASS ssl sslflags=DONT_VERIFY_PEER front-end-https=auto ";
+ $conf .= "name={$cfg[0]}\n";
+ }}}
//ACLs
if (($settings['reverse_owa'] == 'on') && (!empty($settings['reverse_owa_ip']))) {
@@ -1032,19 +1033,18 @@ function squid_resync_reverse() {
$conf .= "extension_methods RPC_IN_DATA RPC_OUT_DATA\n";
}
-
$contents = base64_decode($settings['revrse_uri']);
if(!empty($contents)) {
$conf .= "# -= TESTING AREA =-\n";
$defs = explode("\r\n", ($contents));
foreach ($defs as $def) {
- if (($cfg[0]) != '' && ($cfg[1]) != '')
- $cfg = explode(";",($def));
+ $cfg = explode(";",($def));
+ if (($cfg[0]) != '' && ($cfg[1]) != ''){
$conf .= "# acl {$cfg[0]} url_regex -i {$settings['reverse_external_fqdn']} {$cfg[1]}.*$\n";
// if($cfg[3] == 'HTTPS')
// $conf .= "login=PASS ssl sslflags=DONT_VERIFY_PEER front-end-https=auto ";
// $conf .= "name={$cfg[0]}\n";
- }}
+ }}}
//ACCESS
@@ -1062,11 +1062,12 @@ $conf .= "# -= TESTING AREA =-\n";
$defs = explode("\r\n", ($contents));
foreach ($defs as $def) {
$cfg = explode(";",($def));
- $conf .= "# cache_peer_access {$cfg[0]} allow {$cfg[1]}\n";
- $conf .= "# cache_peer_access {$cfg[0]} deny all\n";
- $conf .= "# never direct allow {$cfg[1]}\n";
- $conf .= "# http_access allow {$cfg[1]}\n";
- }}
+ if (($cfg[0]) != '' && ($cfg[1]) != ''){
+ $conf .= "# cache_peer_access {$cfg[0]} allow {$cfg[1]}\n";
+ $conf .= "# cache_peer_access {$cfg[0]} deny all\n";
+ $conf .= "# never direct allow {$cfg[1]}\n";
+ $conf .= "# http_access allow {$cfg[1]}\n";
+ }}}
$conf .= "\n";