X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fproxy.cgi;h=901ed7250466d84a2aa6a0c043a3b3745d5e6098;hb=6bea848d3476dd042d0a4f0f9eca63f7773e503c;hp=b217de361cfacc02dcea2d78ee7f23da81930324;hpb=5114bcb3cdee18bdb30b71e9e0df2b559b561273;p=ipfire-2.x.git diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index b217de361c..901ed72504 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2012 IPFire Team # +# Copyright (C) 2007-2013 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -221,6 +221,7 @@ $proxysettings{'MEM_POLICY'} = 'LRU'; $proxysettings{'CACHE_POLICY'} = 'LRU'; $proxysettings{'L1_DIRS'} = '16'; $proxysettings{'OFFLINE_MODE'} = 'off'; +$proxysettings{'CACHE_DIGESTS'} = 'off'; $proxysettings{'CLASSROOM_EXT'} = 'off'; $proxysettings{'SUPERVISOR_PASSWORD'} = ''; $proxysettings{'NO_PROXY_LOCAL'} = 'off'; @@ -358,12 +359,17 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} $errormessage = $Lang::tr{'advproxy errmsg invalid proxy port'}; goto ERROR; } - if (!($proxysettings{'UPSTREAM_PROXY'} eq '')) { - my @temp = split(/:/,$proxysettings{'UPSTREAM_PROXY'}); - if (!(&General::validip($temp[0]))) { - $errormessage = $Lang::tr{'advproxy errmsg invalid upstream proxy'}; - goto ERROR; - } + if (!($proxysettings{'UPSTREAM_PROXY'} eq '')) + { + my @temp = split(/:/,$proxysettings{'UPSTREAM_PROXY'}); + if (!(&General::validip($temp[0]))) + { + if (!(&General::validdomainname($temp[0]))) + { + $errormessage = $Lang::tr{'advproxy errmsg invalid upstream proxy'}; + goto ERROR; + } + } } if (!($proxysettings{'CACHE_SIZE'} =~ /^\d+/) || ($proxysettings{'CACHE_SIZE'} < 10)) @@ -512,8 +518,11 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'} } if (!&General::validip($proxysettings{'LDAP_SERVER'})) { - $errormessage = $Lang::tr{'advproxy errmsg ldap server'}; - goto ERROR; + if (!&General::validdomainname($proxysettings{'LDAP_SERVER'})) + { + $errormessage = $Lang::tr{'advproxy errmsg ldap server'}; + goto ERROR; + } } if (!&General::validport($proxysettings{'LDAP_PORT'})) { @@ -729,6 +738,9 @@ $selected{'L1_DIRS'}{$proxysettings{'L1_DIRS'}} = "selected='selected'"; $checked{'OFFLINE_MODE'}{'off'} = ''; $checked{'OFFLINE_MODE'}{'on'} = ''; $checked{'OFFLINE_MODE'}{$proxysettings{'OFFLINE_MODE'}} = "checked='checked'"; +$checked{'CACHE_DIGESTS'}{'off'} = ''; +$checked{'CACHE_DIGESTS'}{'on'} = ''; +$checked{'CACHE_DIGESTS'}{$proxysettings{'CACHE_DIGESTS'}} = "checked='checked'"; $checked{'LOGGING'}{'off'} = ''; $checked{'LOGGING'}{'on'} = ''; @@ -1162,6 +1174,10 @@ print <$Lang::tr{'advproxy offline mode'}: + + $Lang::tr{'advproxy cache-digest'}: + +
@@ -3089,7 +3105,8 @@ END print FILE "error_directory $errordir/$proxysettings{'ERR_LANGUAGE'}\n\n"; if ($proxysettings{'OFFLINE_MODE'} eq 'on') { print FILE "offline_mode on\n\n"; } - + if ($proxysettings{'CACHE_DIGESTS'} eq 'on') { print FILE "digest_generation on\n\n"; } else { print FILE "digest_generation off\n\n"; } + if ((!($proxysettings{'MEM_POLICY'} eq 'LRU')) || (!($proxysettings{'CACHE_POLICY'} eq 'LRU'))) { if (!($proxysettings{'MEM_POLICY'} eq 'LRU')) @@ -3548,15 +3565,15 @@ if ($delaypools) { if ($proxysettings{'NO_PROXY_LOCAL'} eq 'on') { - print FILE "#Prevent internal proxy access to Green\n"; - print FILE "http_access deny IPFire_green_servers !IPFire_green_network\n\n"; + print FILE "#Prevent internal proxy access to Green except IPFire itself\n"; + print FILE "http_access deny IPFire_green_servers !IPFire_ips !IPFire_green_network\n\n"; } if ($proxysettings{'NO_PROXY_LOCAL_BLUE'} eq 'on') { - print FILE "#Prevent internal proxy access from Blue\n"; + print FILE "#Prevent internal proxy access from Blue except IPFire itself\n"; print FILE "http_access allow IPFire_blue_network IPFire_blue_servers\n"; - print FILE "http_access deny IPFire_blue_network IPFire_servers\n\n"; + print FILE "http_access deny IPFire_blue_network !IPFire_ips IPFire_servers\n\n"; } print FILE <