diff options
author | doktornotor <notordoktor@gmail.com> | 2015-11-28 10:45:39 +0100 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-11-28 10:45:39 +0100 |
commit | 39ff3c94637f2d38e6b1a68104a194ee2402df30 (patch) | |
tree | d1a608ea116bc3d2747290171be788ca000fadcd /config | |
parent | a21e09c9215a40d3de738ba7f3fa87209eb949e8 (diff) | |
download | pfsense-packages-39ff3c94637f2d38e6b1a68104a194ee2402df30.tar.gz pfsense-packages-39ff3c94637f2d38e6b1a68104a194ee2402df30.tar.bz2 pfsense-packages-39ff3c94637f2d38e6b1a68104a194ee2402df30.zip |
Add a function to check whether Squid reverse proxy is enabled
To be used in squid.inc's squid_enabled()
Diffstat (limited to 'config')
-rwxr-xr-x | config/squid3/34/squid_reverse.inc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/config/squid3/34/squid_reverse.inc b/config/squid3/34/squid_reverse.inc index 15217a33..559c9d5b 100755 --- a/config/squid3/34/squid_reverse.inc +++ b/config/squid3/34/squid_reverse.inc @@ -327,6 +327,25 @@ function squid_refresh_crl() { } } +/* Check whether Squid reverse proxy is enabled */ +function squid_reverse_enabled() { + global $config, $reverse_proxy_enabled; + $reverse_proxy_enabled = false; + + if (is_array($config['installedpackages']['squidreversegeneral']['config'])) { + // check whether HTTP or HTTPS reverse proxy is enabled ... + if ($config['installedpackages']['squidreversegeneral']['config'][0]['reverse_http'] == "on" || + $config['installedpackages']['squidreversegeneral']['config'][0]['reverse_https'] == "on") { + // ... and has at least one reverse interface configured + if ($config['installedpackages']['squidreversegeneral']['config'][0]['reverse_interface'] != "") { + $reverse_proxy_enabled = true; + } + } + } + + return $reverse_proxy_enabled; +} + /* Migrate reverse proxy configuration from old Squid package versions */ function squid_reverse_upgrade_config() { global $config; |