]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/proxy.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 # (c) 2004-2009 marco.s - http://www.advproxy.net
24 # This code is distributed under the terms of the GPL
26 # $Id: advproxy.cgi,v 3.0.2 2009/02/04 00:00:00 marco.s Exp $
32 # enable only the following on debugging purpose
34 #use CGI::Carp 'fatalsToBrowser';
36 require '/var/ipfire/general-functions.pl' ;
37 require "${General::swroot}/lang.pl" ;
38 require "${General::swroot}/header.pl" ;
40 my @squidversion = `/usr/sbin/squid -v` ;
45 my %mainsettings = ();
46 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
47 & General
:: readhash
( "/srv/web/ipfire/html/themes/" . $mainsettings { 'THEME' }. "/include/colors.txt" , \
%color );
51 my %filtersettings =();
52 my %xlratorsettings =();
53 my %stdproxysettings =();
59 my @throttle_limits =( 64 , 128 , 256 , 512 , 1024 , 1536 , 2048 , 3072 , 4096 , 5120 , 6144 , 7168 , 8192 , 10240 , 16384 , 20480 , 51200 , 102400 );
61 my $def_ports_safe = "80 # http \n 21 # ftp \n 443 # https \n 563 # snews \n 70 # gopher \n 210 # wais \n 1025-65535 # unregistered ports \n 280 # http-mgmt \n 488 # gss-http \n 591 # filemaker \n 777 # multiling http \n 800 # Squids port (for icons) \n " ;
62 my $def_ports_ssl = "443 # https \n 563 # snews \n " ;
64 my $hintcolour = '#FFFFCC' ;
65 my $ncsa_buttontext = '' ;
80 my $browser_regexp = '' ;
84 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
85 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
86 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
87 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
88 my $credir = "${General::swroot}/proxy/advanced/cre" ;
90 my $userdb = " $ncsadir /passwd" ;
91 my $stdgrp = " $ncsadir /standard.grp" ;
92 my $extgrp = " $ncsadir /extended.grp" ;
93 my $disgrp = " $ncsadir /disabled.grp" ;
95 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
96 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
98 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
99 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
100 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
102 my $identhosts = " $identdir /hosts" ;
104 my $authdir = "/usr/lib/squid" ;
105 my $errordir = "/usr/lib/squid/errors" ;
107 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
108 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
109 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
110 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
111 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
112 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
113 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
114 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
115 my $acl_dst_noauth_dom = " $acldir /dst_noauth_dom.acl" ;
116 my $acl_dst_noauth_net = " $acldir /dst_noauth_net.acl" ;
117 my $acl_dst_noauth_url = " $acldir /dst_noauth_url.acl" ;
118 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
119 my $acl_dst_nocache_dom = " $acldir /dst_nocache_dom.acl" ;
120 my $acl_dst_nocache_net = " $acldir /dst_nocache_net.acl" ;
121 my $acl_dst_nocache_url = " $acldir /dst_nocache_url.acl" ;
122 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
123 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
124 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
125 my $acl_include = " $acldir /include.acl" ;
127 my $acl_dst_noproxy_url = " $acldir /dst_noproxy_url.acl" ;
128 my $acl_dst_noproxy_ip = " $acldir /dst_noproxy_ip.acl" ;
130 my $updaccelversion = 'n/a' ;
131 my $urlfilterversion = 'n/a' ;
133 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
134 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
135 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
136 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
137 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
139 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
140 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
142 unless (- e
$userdb ) { system ( "touch $userdb " ); }
143 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
144 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
145 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
147 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
148 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
149 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
150 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
151 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
152 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
153 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
154 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
155 unless (- e
$acl_dst_noauth_dom ) { system ( "touch $acl_dst_noauth_dom " ); }
156 unless (- e
$acl_dst_noauth_net ) { system ( "touch $acl_dst_noauth_net " ); }
157 unless (- e
$acl_dst_noauth_url ) { system ( "touch $acl_dst_noauth_url " ); }
158 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
159 unless (- e
$acl_dst_nocache_dom ) { system ( "touch $acl_dst_nocache_dom " ); }
160 unless (- e
$acl_dst_nocache_net ) { system ( "touch $acl_dst_nocache_net " ); }
161 unless (- e
$acl_dst_nocache_url ) { system ( "touch $acl_dst_nocache_url " ); }
162 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
163 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
164 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
165 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
167 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
169 my $HAVE_NTLM_AUTH = (- e
"/usr/bin/ntlm_auth" );
171 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
172 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
174 my $green_cidr = & General
:: ipcidr
( " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'}" );
176 if (& Header
:: blue_used
() && $netsettings { 'BLUE_DEV' }) {
177 $blue_cidr = & General
:: ipcidr
( " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'}" );
180 & Header
:: showhttpheaders
();
182 $proxysettings { 'ACTION' } = '' ;
183 $proxysettings { 'VALID' } = '' ;
185 $proxysettings { 'ENABLE' } = 'off' ;
186 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
187 $proxysettings { 'TRANSPARENT' } = 'off' ;
188 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
189 $proxysettings { 'PROXY_PORT' } = '800' ;
190 $proxysettings { 'TRANSPARENT_PORT' } = '3128' ;
191 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
192 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
193 $proxysettings { 'ADMIN_PASSWORD' } = '' ;
194 $proxysettings { 'ERR_LANGUAGE' } = 'en' ;
195 $proxysettings { 'ERR_DESIGN' } = 'ipfire' ;
196 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
197 $proxysettings { 'FORWARD_VIA' } = 'off' ;
198 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
199 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
200 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
201 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
202 $proxysettings { 'UPSTREAM_USER' } = '' ;
203 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
204 $proxysettings { 'LOGGING' } = 'off' ;
205 $proxysettings { 'CACHEMGR' } = 'off' ;
206 $proxysettings { 'LOGQUERY' } = 'off' ;
207 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
208 $proxysettings { 'FILEDESCRIPTORS' } = '16384' ;
209 $proxysettings { 'CACHE_MEM' } = '128' ;
210 $proxysettings { 'CACHE_SIZE' } = '0' ;
211 $proxysettings { 'MAX_SIZE' } = '4096' ;
212 $proxysettings { 'MIN_SIZE' } = '0' ;
213 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
214 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
215 $proxysettings { 'L1_DIRS' } = '16' ;
216 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
217 $proxysettings { 'CACHE_DIGESTS' } = 'off' ;
218 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
219 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
220 $proxysettings { 'NO_PROXY_LOCAL' } = 'off' ;
221 $proxysettings { 'NO_PROXY_LOCAL_BLUE' } = 'off' ;
222 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
223 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
224 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
225 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
226 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
227 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
228 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
229 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
230 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
231 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
232 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
233 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
234 $proxysettings { 'FAKE_USERAGENT' } = '' ;
235 $proxysettings { 'FAKE_REFERER' } = '' ;
236 $proxysettings { 'AUTH_METHOD' } = 'none' ;
237 $proxysettings { 'AUTH_REALM' } = '' ;
238 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
239 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
240 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
241 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
242 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
243 $proxysettings { 'NCSA_USERNAME' } = '' ;
244 $proxysettings { 'NCSA_GROUP' } = '' ;
245 $proxysettings { 'NCSA_PASS' } = '' ;
246 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
247 $proxysettings { 'LDAP_BASEDN' } = '' ;
248 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
249 $proxysettings { 'LDAP_SERVER' } = '' ;
250 $proxysettings { 'LDAP_PORT' } = '389' ;
251 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
252 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
253 $proxysettings { 'LDAP_GROUP' } = '' ;
254 $proxysettings { 'NTLM_AUTH_GROUP' } = '' ;
255 $proxysettings { 'NTLM_AUTH_BASIC' } = 'off' ;
256 $proxysettings { 'NTLM_DOMAIN' } = '' ;
257 $proxysettings { 'NTLM_PDC' } = '' ;
258 $proxysettings { 'NTLM_BDC' } = '' ;
259 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
260 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
261 $proxysettings { 'RADIUS_SERVER' } = '' ;
262 $proxysettings { 'RADIUS_PORT' } = '1812' ;
263 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
264 $proxysettings { 'RADIUS_SECRET' } = '' ;
265 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
266 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
267 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
268 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
269 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
270 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
271 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
272 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
273 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
275 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
277 & Header
:: getcgihash
( \
%proxysettings );
279 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
280 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
281 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
282 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
284 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
286 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
289 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
291 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
292 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
293 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
295 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
296 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
298 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
299 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
301 if (! $errormessage ) {
302 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
303 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
305 $proxysettings { 'NCSA_USERNAME' } = '' ;
306 $proxysettings { 'NCSA_GROUP' } = '' ;
307 $proxysettings { 'NCSA_PASS' } = '' ;
308 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
311 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
313 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
314 & deluser
( $proxysettings { 'ID' });
317 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
318 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
319 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
321 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
323 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
324 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
325 @temp = split ( /:/ , $proxysettings { 'ID' });
326 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
327 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
328 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
329 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
332 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'proxy reconfigure' }))
334 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
335 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
336 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
337 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
338 $errormessage = $Lang :: tr
{ 'invalid input' };
341 if ( $proxysettings { 'CACHE_MEM' } > $proxysettings { 'CACHE_SIZE' } && $proxysettings { 'CACHE_SIZE' } > 0 ){
342 $errormessage = $Lang :: tr
{ 'advproxy errmsg cache' }. " " . $proxysettings { 'CACHE_MEM' }. " > " . $proxysettings { 'CACHE_SIZE' };
346 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
348 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
351 if (!(& General
:: validport
( $proxysettings { 'TRANSPARENT_PORT' })))
353 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
356 if ( $proxysettings { 'PROXY_PORT' } eq $proxysettings { 'TRANSPARENT_PORT' }) {
357 $errormessage = $Lang :: tr
{ 'advproxy errmsg proxy ports equal' };
360 if (!( $proxysettings { 'UPSTREAM_PROXY' } eq '' ))
362 my @temp = split ( /:/ , $proxysettings { 'UPSTREAM_PROXY' });
363 if (!(& General
:: validip
( $temp [ 0 ])))
365 if (!(& General
:: validdomainname
( $temp [ 0 ])))
367 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy' };
372 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
373 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
375 if (!( $proxysettings { 'CACHE_SIZE' } eq '0' ))
377 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
381 if (!( $proxysettings { 'FILEDESCRIPTORS' } =~ /^\d+/ ) ||
382 ( $proxysettings { 'FILEDESCRIPTORS' } < 1 ) || ( $proxysettings { 'FILEDESCRIPTORS' } > 1048576 ))
384 $errormessage = $Lang :: tr
{ 'proxy errmsg filedescriptors' };
387 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ))
389 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
392 my @free = `/usr/bin/free` ;
393 $free [ 1 ] =~ m/(\d+)/ ;
394 $cachemem = int $1 / 2048 ;
395 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
396 $proxysettings { 'CACHE_MEM' } = $cachemem ;
398 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
400 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
403 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
405 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
408 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
410 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
413 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
415 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
418 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
420 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
423 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
425 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
426 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
427 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
429 if ( $netsettings { 'BLUE_DEV' })
431 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
432 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
434 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
438 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
440 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
445 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
447 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
450 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
451 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
453 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
456 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' ))
458 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
461 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
463 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
467 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
469 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
471 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
475 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
477 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
479 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
483 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
485 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
487 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
490 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
492 if (!& General
:: validdomainname
( $proxysettings { 'LDAP_SERVER' }))
494 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
498 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
500 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
503 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
505 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
507 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
512 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
514 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
516 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
519 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
521 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
524 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
526 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
531 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
534 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
535 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
536 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
537 if (( $proxy1 ne $proxy2 ))
539 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
547 $proxysettings { 'VALID' } = 'no' ; }
549 $proxysettings { 'VALID' } = 'yes' ; }
551 if ( $proxysettings { 'VALID' } eq 'yes' )
555 delete $proxysettings { 'SRC_SUBNETS' };
556 delete $proxysettings { 'SRC_BANNED_IP' };
557 delete $proxysettings { 'SRC_BANNED_MAC' };
558 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
559 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
560 delete $proxysettings { 'DST_NOCACHE' };
561 delete $proxysettings { 'DST_NOAUTH' };
562 delete $proxysettings { 'DST_NOPROXY_IP' };
563 delete $proxysettings { 'DST_NOPROXY_URL' };
564 delete $proxysettings { 'PORTS_SAFE' };
565 delete $proxysettings { 'PORTS_SSL' };
566 delete $proxysettings { 'MIME_TYPES' };
567 delete $proxysettings { 'NTLM_ALLOW_USERS' };
568 delete $proxysettings { 'NTLM_DENY_USERS' };
569 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
570 delete $proxysettings { 'RADIUS_DENY_USERS' };
571 delete $proxysettings { 'IDENT_HOSTS' };
572 delete $proxysettings { 'IDENT_ALLOW_USERS' };
573 delete $proxysettings { 'IDENT_DENY_USERS' };
575 delete $proxysettings { 'CRE_GROUPS' };
576 delete $proxysettings { 'CRE_SVHOSTS' };
578 delete $proxysettings { 'NCSA_USERNAME' };
579 delete $proxysettings { 'NCSA_GROUP' };
580 delete $proxysettings { 'NCSA_PASS' };
581 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
583 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
584 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
585 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
586 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
587 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
588 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
589 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
591 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
592 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
594 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
596 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
597 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
598 $stdproxysettings { 'UPSTREAM_PROXY' } = $proxysettings { 'UPSTREAM_PROXY' };
599 $stdproxysettings { 'UPSTREAM_USER' } = $proxysettings { 'UPSTREAM_USER' };
600 $stdproxysettings { 'UPSTREAM_PASSWORD' } = $proxysettings { 'UPSTREAM_PASSWORD' };
601 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
602 $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' };
603 $stdproxysettings { 'ENABLE_CLAMAV' } = $proxysettings { 'ENABLE_CLAMAV' };
604 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
609 if ( $proxysettings { 'CACHEMGR' } eq 'on' ){& writecachemgr
;}
611 system ( '/usr/local/bin/squidctrl' , 'disable' );
612 unlink "${General::swroot}/proxy/enable" ;
613 unlink "${General::swroot}/proxy/transparent" ;
614 unlink "${General::swroot}/proxy/enable_blue" ;
615 unlink "${General::swroot}/proxy/transparent_blue" ;
617 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
618 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable" );
619 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
620 if ( $proxysettings { 'TRANSPARENT' } eq 'on' && $proxysettings { 'ENABLE' } eq 'on' ) {
621 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent" ); }
622 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
623 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable_blue" );
624 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
625 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
626 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
628 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/squidctrl restart >/dev/null 2>&1' ); }
629 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'proxy reconfigure' }) { system ( '/usr/local/bin/squidctrl reconfigure >/dev/null 2>&1' ); }
633 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
635 system ( '/usr/local/bin/squidctrl flush >/dev/null 2>&1' );
640 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
641 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
642 } elsif (- e
"${General::swroot}/proxy/settings" ) {
643 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
648 # ------------------------------------------------------------------
650 # Hook to regenerate the configuration files, if cgi got called from command line.
651 if ( $ENV { "REMOTE_ADDR" } eq "" ) {
656 # -------------------------------------------------------------------
658 $checked { 'ENABLE' }{ 'off' } = '' ;
659 $checked { 'ENABLE' }{ 'on' } = '' ;
660 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
662 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
663 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
664 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
666 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
667 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
668 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
670 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
671 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
672 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
674 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
675 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
676 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
678 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
679 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
680 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
681 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
682 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
683 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
684 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
685 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
686 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
687 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
688 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
689 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
691 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
692 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
693 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
694 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
695 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
696 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
697 $checked { 'CACHE_DIGESTS' }{ 'off' } = '' ;
698 $checked { 'CACHE_DIGESTS' }{ 'on' } = '' ;
699 $checked { 'CACHE_DIGESTS' }{ $proxysettings { 'CACHE_DIGESTS' }} = "checked='checked'" ;
701 $checked { 'LOGGING' }{ 'off' } = '' ;
702 $checked { 'LOGGING' }{ 'on' } = '' ;
703 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
704 $checked { 'CACHEMGR' }{ 'off' } = '' ;
705 $checked { 'CACHEMGR' }{ 'on' } = '' ;
706 $checked { 'CACHEMGR' }{ $proxysettings { 'CACHEMGR' }} = "checked='checked'" ;
707 $checked { 'LOGQUERY' }{ 'off' } = '' ;
708 $checked { 'LOGQUERY' }{ 'on' } = '' ;
709 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
710 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
711 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
712 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
714 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
715 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
717 $checked { 'NO_PROXY_LOCAL' }{ 'off' } = '' ;
718 $checked { 'NO_PROXY_LOCAL' }{ 'on' } = '' ;
719 $checked { 'NO_PROXY_LOCAL' }{ $proxysettings { 'NO_PROXY_LOCAL' }} = "checked='checked'" ;
720 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'off' } = '' ;
721 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'on' } = '' ;
722 $checked { 'NO_PROXY_LOCAL_BLUE' }{ $proxysettings { 'NO_PROXY_LOCAL_BLUE' }} = "checked='checked'" ;
724 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
725 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
726 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
728 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
729 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
730 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
731 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
732 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
734 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
735 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
736 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
737 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
738 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
739 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
740 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
742 $checked { 'TIME_MON' }{ 'off' } = '' ;
743 $checked { 'TIME_MON' }{ 'on' } = '' ;
744 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
745 $checked { 'TIME_TUE' }{ 'off' } = '' ;
746 $checked { 'TIME_TUE' }{ 'on' } = '' ;
747 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
748 $checked { 'TIME_WED' }{ 'off' } = '' ;
749 $checked { 'TIME_WED' }{ 'on' } = '' ;
750 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
751 $checked { 'TIME_THU' }{ 'off' } = '' ;
752 $checked { 'TIME_THU' }{ 'on' } = '' ;
753 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
754 $checked { 'TIME_FRI' }{ 'off' } = '' ;
755 $checked { 'TIME_FRI' }{ 'on' } = '' ;
756 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
757 $checked { 'TIME_SAT' }{ 'off' } = '' ;
758 $checked { 'TIME_SAT' }{ 'on' } = '' ;
759 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
760 $checked { 'TIME_SUN' }{ 'off' } = '' ;
761 $checked { 'TIME_SUN' }{ 'on' } = '' ;
762 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
764 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
765 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
766 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
767 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
769 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
770 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
771 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
773 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
774 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
775 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
776 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
777 $checked { 'AUTH_METHOD' }{ 'ntlm-auth' } = '' ;
778 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
779 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
781 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
783 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
784 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
785 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
787 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
788 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
789 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
791 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
793 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
795 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
797 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
798 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
799 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
801 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
802 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
803 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
805 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
806 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
807 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
809 $checked { 'NTLM_AUTH_BASIC' }{ 'on' } = '' ;
810 $checked { 'NTLM_AUTH_BASIC' }{ 'off' } = '' ;
811 $checked { 'NTLM_AUTH_BASIC' }{ $proxysettings { 'NTLM_AUTH_BASIC' }} = "checked='checked'" ;
813 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
814 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
815 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
817 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
818 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
819 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
821 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
822 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
823 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
825 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
826 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
827 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
829 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
830 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
831 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
833 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
834 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
835 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
837 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
838 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
839 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
841 $checked { 'ENABLE_CLAMAV' }{ 'off' } = '' ;
842 $checked { 'ENABLE_CLAMAV' }{ 'on' } = '' ;
843 $checked { 'ENABLE_CLAMAV' }{ $proxysettings { 'ENABLE_CLAMAV' }} = "checked='checked'" ;
845 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
847 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
850 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
851 print "<font class='base'> $errormessage </font> \n " ;
855 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
857 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
858 $squidversion [ 0 ] =~ s/^\s+//g ;
859 $squidversion [ 0 ] =~ s/\s+$//g ;
861 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
864 # ===================================================================
866 # ===================================================================
868 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
870 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
872 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
877 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
880 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
881 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
882 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}: <img src='/blob.gif' alt='*' /></td>
883 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
886 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
887 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
888 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port transparent'}: <img src='/blob.gif' alt='*' /></td>
889 <td width='30%'><input type='text' name='TRANSPARENT_PORT' value=' $proxysettings {'TRANSPARENT_PORT'}' size='5' /></td>
894 if ( $netsettings { 'BLUE_DEV' }) {
895 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
896 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
898 print "<td colspan='2'> </td>" ;
901 <td class='base'> $Lang ::tr{'advproxy visible hostname'}:</td>
902 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
907 if ( $netsettings { 'BLUE_DEV' }) {
908 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
909 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
911 print "<td colspan='2'> </td>" ;
914 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
916 <select name='ERR_LANGUAGE'>
919 foreach (< $errordir /*>) {
921 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
922 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
930 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
931 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
932 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
933 <td class='base'><select name='ERR_DESIGN'>
934 <option value='ipfire' $selected {'ERR_DESIGN'}{'ipfire'}>IPFire</option>
935 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
939 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
940 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
949 if ( - e
"/usr/bin/squidclamav" ) {
950 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy squidclamav' }. "</b><br />" ;
951 if ( ! - e
"/var/run/clamav/clamd.pid" ){
952 print "<font color='red'>clamav not running</font><br /><br />" ;
953 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
956 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_CLAMAV' ".$checked{'ENABLE_CLAMAV'}{'on'} . " /><br />" ;
962 print "<td class='base'><a href='/cgi-bin/urlfilter.cgi'><b>" . $Lang :: tr
{ 'advproxy url filter' }. "</a></b><br />" ;
963 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'} . " /><br />" ;
965 print "<td class='base'><a href='/cgi-bin/updatexlrator.cgi'><b>" . $Lang :: tr
{ 'advproxy update accelerator' }. "</a></b><br />" ;
966 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'} . " /><br />" ;
973 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
976 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}:</td>
977 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
978 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'}:</td>
979 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
982 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td>
983 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
984 <td class='base'> $Lang ::tr{'advproxy upstream username'}:</td>
985 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
988 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td>
989 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
990 <td class='base'> $Lang ::tr{'advproxy upstream password'}:</td>
991 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
994 <td class='base'> $Lang ::tr{'advproxy no connection auth'}:</td>
995 <td><input type='checkbox' name='NO_CONNECTION_AUTH' $checked {'NO_CONNECTION_AUTH'}{'on'} /></td>
1001 <table width='100%'>
1003 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
1006 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
1007 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
1008 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
1009 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
1014 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
1015 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
1019 <table width='100%'>
1021 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
1024 <td class='base'><a href='/cgi-bin/cachemgr.cgi' target='_blank'> $Lang ::tr{'proxy cachemgr'}:</td>
1025 <td><input type='checkbox' name='CACHEMGR' $checked {'CACHEMGR'}{'on'} /></td>
1026 <td class='base'> $Lang ::tr{'advproxy admin mail'}:</td>
1027 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
1030 <td class='base'> $Lang ::tr{'proxy filedescriptors'}: <img src='/blob.gif' alt='*' /></td>
1031 <td><input type='text' name='FILEDESCRIPTORS' value=' $proxysettings {'FILEDESCRIPTORS'}' size='5' /></td>
1032 <td class='base'> $Lang ::tr{'proxy admin password'}:</td>
1033 <td><input type='text' name='ADMIN_PASSWORD' value=' $proxysettings {'ADMIN_PASSWORD'}' /></td>
1036 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1039 <td class='base'> $Lang ::tr{'advproxy ram cache size'}: <img src='/blob.gif' alt='*' /></td>
1040 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
1041 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}: <img src='/blob.gif' alt='*' /></td>
1042 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
1045 <td class='base'> $Lang ::tr{'advproxy min size'}: <img src='/blob.gif' alt='*' /></td>
1046 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
1047 <td class='base'> $Lang ::tr{'advproxy max size'}: <img src='/blob.gif' alt='*' /></td>
1048 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
1051 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
1052 <td class='base'><select name='L1_DIRS'>
1053 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
1054 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
1055 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
1056 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
1057 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
1059 <td colspan='2' rowspan= '5' valign='top' class='base'>
1060 <table cellspacing='0' cellpadding='0'>
1062 <!-- intentionally left empty -->
1065 <td> $Lang ::tr{'advproxy no cache sites'}:</td>
1068 <!-- intentionally left empty -->
1071 <!-- intentionally left empty -->
1074 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1078 print $proxysettings { 'DST_NOCACHE' };
1087 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1088 <td class='base'><select name='MEM_POLICY'>
1089 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1090 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1091 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1092 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1096 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1097 <td class='base'><select name='CACHE_POLICY'>
1098 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1099 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1100 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1101 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1105 <td colspan='2'> </td>
1108 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1109 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1112 <td class='base'> $Lang ::tr{'advproxy cache-digest'}:</td>
1113 <td><input type='checkbox' name='CACHE_DIGESTS' $checked {'CACHE_DIGESTS'}{'on'} /></td>
1117 <table width='100%'>
1119 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1122 <td width='25%' align='center'></td> <td width='20%' align='center'></td><td width='25%' align='center'></td><td width='30%' align='center'></td>
1125 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}: <img src='/blob.gif' alt='*' /></td>
1126 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}: <img src='/blob.gif' alt='*' /></td>
1129 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1132 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1136 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1139 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1146 <table width='100%'>
1148 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1151 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1154 <td colspan='4' class='base'> $Lang ::tr{'advproxy allowed subnets'}: <img src='/blob.gif' alt='*' /></td>
1157 <td colspan='2' rowspan='4'><textarea name='SRC_SUBNETS' cols='32' rows='3' wrap='off'>
1161 if (! $proxysettings { 'SRC_SUBNETS' })
1163 print " $green_cidr \n " ;
1164 if ( $netsettings { 'BLUE_DEV' })
1166 print " $blue_cidr \n " ;
1168 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1175 $line = $Lang :: tr
{ 'advproxy no internal proxy on green' };
1176 $line =~ s/Green/<font color="$Header::colourgreen">Green<\/ font
>/ i
;
1177 print "<td class='base'> $line :</td> \n " ;
1179 <td><input type='checkbox' name='NO_PROXY_LOCAL' $checked {'NO_PROXY_LOCAL'}{'on'} /></td>
1183 if ( $netsettings { 'BLUE_DEV' }) {
1184 $line = $Lang :: tr
{ 'advproxy no internal proxy on blue' };
1185 $line =~ s/Blue/<font color="$Header::colourblue">Blue<\/ font
>/ i
;
1187 print "<td class='base'> $line :</td> \n " ;
1189 <td><input type='checkbox' name='NO_PROXY_LOCAL_BLUE' $checked {'NO_PROXY_LOCAL_BLUE'}{'on'} /></td>
1196 <td colspan='2'> </td>
1199 <td colspan='2'> </td>
1202 <table width='100%'>
1204 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1207 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}:</td>
1208 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}:</td>
1211 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='3' wrap='off'>
1215 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1219 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='3' wrap='off'>
1223 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1229 <table width='100%'>
1231 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1234 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}:</td>
1235 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}:</td>
1238 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='3' wrap='off'>
1242 print $proxysettings { 'SRC_BANNED_IP' };
1246 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='3' wrap='off'>
1250 print $proxysettings { 'SRC_BANNED_MAC' };
1261 # -------------------------------------------------------------------
1262 # CRE GUI - optional
1263 # -------------------------------------------------------------------
1265 if (- e
$cre_enabled ) { print <<END
1266 <table width='100%'>
1269 <td colspan='4'><b> $Lang ::tr{'advproxy classroom extensions'}</b> $Lang::tr{'advproxy enabled'}:<input type='checkbox' name='CLASSROOM_EXT' $checked{'CLASSROOM_EXT'}{'on'} /></td>
1272 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1278 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1280 <td class='base'> $Lang ::tr{'advproxy supervisor password'}:</td>
1281 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1284 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1285 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}:</td>
1290 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1293 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1297 print $proxysettings { 'CRE_GROUPS' };
1301 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1304 print $proxysettings { 'CRE_SVHOSTS' };
1312 print "</table><hr size='1'>" ;
1316 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1317 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1318 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1323 # ===================================================================
1325 # ===================================================================
1328 <table width='100%'>
1330 <td colspan='4'><b> $Lang ::tr{'advproxy wpad title'}</b></td>
1333 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1336 <td colspan='2' class='base'> $Lang ::tr{'advproxy wpad label dst_noproxy_ip'}:</td>
1337 <td colspan='2' class='base'> $Lang ::tr{'advproxy wpad label dst_noproxy_url'}:</td>
1340 <td colspan='2'><textarea name='DST_NOPROXY_IP' cols='32' rows='3' wrap='off'>
1344 print $proxysettings { 'DST_NOPROXY_IP' };
1349 <td colspan='2'><textarea name='DST_NOPROXY_URL' cols='32' rows='3' wrap='off'>
1353 print $proxysettings { 'DST_NOPROXY_URL' };
1359 <td colspan='2' class='base'> $Lang ::tr{'advproxy wpad example dst_noproxy_ip'}</td>
1360 <td colspan='2' class='base'> $Lang ::tr{'advproxy wpad example dst_noproxy_url'}</td>
1363 <td colspan="4"> </td>
1366 <td colspan="4"> $Lang ::tr{'advproxy wpad view pac'}: <a href="http:// $ENV {SERVER_ADDR}:81/wpad.dat" target="_blank">http:// $ENV {SERVER_ADDR}:81/wpad.dat</a></td>
1369 <td colspan="4"> </td>
1372 <td colspan="4"> $Lang ::tr{'advproxy wpad notice'}</td>
1381 # -------------------------------------------------------------------
1385 <table width='100%'>
1387 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1389 <table width='100%'>
1391 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1392 <td width='1%'> </td>
1393 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1394 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1395 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1396 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1397 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1398 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1399 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1400 <td width='1%'> </td>
1401 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1402 <td width='1%'> </td>
1403 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1408 <select name='TIME_ACCESS_MODE'>
1409 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1410 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1414 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1415 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1416 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1417 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1418 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1419 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1420 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1423 <select name='TIME_FROM_HOUR'>
1426 for ( $i = 0 ; $i <= 24 ; $i ++) {
1427 $_ = sprintf ( " %02s " , $i );
1428 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1435 <select name='TIME_FROM_MINUTE'>
1438 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1439 $_ = sprintf ( " %02s " , $i );
1440 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1447 <select name='TIME_TO_HOUR'>
1450 for ( $i = 0 ; $i <= 24 ; $i ++) {
1451 $_ = sprintf ( " %02s " , $i );
1452 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1459 <select name='TIME_TO_MINUTE'>
1462 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1463 $_ = sprintf ( " %02s " , $i );
1464 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1472 <table width='100%'>
1474 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1477 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}: <img src='/blob.gif' alt='*' /></td>
1478 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1479 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}: <img src='/blob.gif' alt='*' /></td>
1480 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1484 <table width='100%'>
1486 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1489 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1490 <td width='20%' class='base'>
1491 <select name='THROTTLING_GREEN_TOTAL'>
1495 foreach ( @throttle_limits ) {
1497 my $unit = "kbit/s" ;
1504 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $val $unit </option> \n " ;
1508 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1511 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1512 <td width='30%' class='base'>
1513 <select name='THROTTLING_GREEN_HOST'>
1517 foreach ( @throttle_limits ) {
1518 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kbit/s</option> \n " ;
1522 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1529 if ( $netsettings { 'BLUE_DEV' }) {
1532 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1534 <select name='THROTTLING_BLUE_TOTAL'>
1538 foreach ( @throttle_limits ) {
1539 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kbit/s</option> \n " ;
1543 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1546 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1548 <select name='THROTTLING_BLUE_HOST'>
1552 foreach ( @throttle_limits ) {
1553 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kbit/s</option> \n " ;
1557 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1568 <table width='100%'>
1570 <td colspan='4'><b> $Lang ::tr{'advproxy MIME filter'}</b> $Lang::tr{'advproxy enabled'}:<input type='checkbox' name='ENABLE_MIME_FILTER' $checked{'ENABLE_MIME_FILTER'}{'on'} /></td>
1574 if ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' ){
1577 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}:</td>
1582 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1586 print $proxysettings { 'MIME_TYPES' };
1601 <table width='100%'>
1603 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1606 <td class='base'> $Lang ::tr{'advproxy fake useragent'}:</td>
1607 <td class='base'> $Lang ::tr{'advproxy fake referer'}:</td>
1610 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='40%' /></td>
1611 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='40%' /></td>
1618 my $auth_columns = 5 ;
1619 if ( $HAVE_NTLM_AUTH ) {
1622 my $auth_column_width = 100 / $auth_columns ;
1625 <table width='100%'>
1627 <td colspan=' $auth_columns '><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1630 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1631 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1632 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1633 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1636 if ( $HAVE_NTLM_AUTH ) {
1638 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm-auth' $checked {'AUTH_METHOD'}{'ntlm-auth'} /> $Lang ::tr{'advproxy AUTH method ntlm auth'}</td>
1643 <td width=' $auth_column_width %' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1649 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1651 <table width='100%'>
1653 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1656 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1659 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1660 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1661 <td colspan='2' rowspan= '6' valign='top' class='base'>
1662 <table cellpadding='0' cellspacing='0'>
1664 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}:</td>
1667 <!-- intentionally left empty -->
1670 <!-- intentionally left empty -->
1673 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1676 <!-- intentionally left empty -->
1679 <!-- intentionally left empty -->
1682 <td> $Lang ::tr{'advproxy AUTH no auth'}:</td>
1685 <!-- intentionally left empty -->
1688 <!-- intentionally left empty -->
1691 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1695 print $proxysettings { 'DST_NOAUTH' };
1704 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1705 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1708 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}:</td>
1709 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1712 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1713 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1716 <td colspan='2'> </td>
1723 # ===================================================================
1724 # NCSA auth settings
1725 # ===================================================================
1727 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1730 <table width='100%'>
1732 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1735 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1736 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1737 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1738 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1741 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1749 # ===================================================================
1750 # IDENTD auth settings
1751 # ===================================================================
1753 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1756 <table width='100%'>
1758 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1761 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1762 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1763 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1764 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1767 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1768 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1773 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1774 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}:</td>
1777 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1780 if (! $proxysettings { 'IDENT_HOSTS' }) {
1781 print " $green_cidr \n " ;
1782 if ( $netsettings { 'BLUE_DEV' }) {
1783 print " $blue_cidr \n " ;
1786 print $proxysettings { 'IDENT_HOSTS' };
1791 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1795 print $proxysettings { 'DST_NOAUTH' };
1802 <table width='100%'>
1804 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1807 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1808 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1809 <td width='25%'> </td>
1810 <td width='30%'> </td>
1813 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1814 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1815 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1816 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1819 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1820 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1823 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1827 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1829 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1831 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1835 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1837 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1844 # ===================================================================
1845 # NTLM-AUTH settings
1846 # ===================================================================
1848 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm-auth' ) {
1851 <table width='100%'>
1852 <td width='20%' class='base'> $Lang ::tr{'advproxy basic authentication'}:</td>
1853 <td width='40%'><input type='checkbox' name='NTLM_AUTH_BASIC' $checked {'NTLM_AUTH_BASIC'}{'on'} /></td>
1854 <td colspan='2'> </td>
1859 <table width='100%'>
1861 <td colspan='4'><b> $Lang ::tr{'advproxy group access control'}</b></td>
1864 <td width='20%' class='base'> $Lang ::tr{'advproxy group required'}:</td>
1865 <td width='40%'><input type='text' name='NTLM_AUTH_GROUP' value=' $proxysettings {'NTLM_AUTH_GROUP'}' size='37' /></td>
1873 # ===================================================================
1874 # LDAP auth settings
1875 # ===================================================================
1877 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1880 <table width='100%'>
1882 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1885 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1886 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1887 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1888 <td class='base'><select name='LDAP_TYPE'>
1889 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1890 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1891 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1892 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1896 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1897 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1898 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1899 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1903 <table width='100%'>
1905 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1908 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1909 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1910 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1911 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1915 <table width='100%'>
1917 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1920 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}:</td>
1921 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1929 # ===================================================================
1930 # RADIUS auth settings
1931 # ===================================================================
1933 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1936 <table width='100%'>
1938 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1941 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1942 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1943 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1944 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1947 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}:</td>
1948 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1949 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1950 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1954 <table width='100%'>
1956 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1959 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1960 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1961 <td width='25%'> </td>
1962 <td width='30%'> </td>
1965 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1966 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1967 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1968 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1971 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1972 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1975 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1979 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
1981 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1983 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
1987 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
1989 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1996 # ===================================================================
2002 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
2004 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2005 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2006 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2007 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
2008 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2009 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
2013 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
2015 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2016 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2017 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2018 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2022 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
2024 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2025 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
2029 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
2031 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
2032 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
2033 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
2034 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
2035 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
2036 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
2037 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
2041 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2043 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2044 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2045 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2046 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2047 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2048 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2049 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2053 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2055 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2056 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2057 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2058 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2059 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2060 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2061 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2062 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2074 <table width='100%'>
2077 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2078 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'proxy reconfigure'}' /></td>
2079 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2080 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2086 <table width='100%'>
2088 <td><img src='/blob.gif' align='top' alt='*' /> <font class='base'> $Lang ::tr{'required field'}</font></td>
2089 <td align='right'> </td>
2096 & Header
:: closebox
();
2100 # ===================================================================
2101 # NCSA user management
2102 # ===================================================================
2104 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2106 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2107 <table width='100%'>
2109 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2112 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2113 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2116 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly='readonly' " ; }
2119 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2121 <select name='NCSA_GROUP'>
2122 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2123 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2124 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2130 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2131 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2132 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2133 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2140 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2141 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2142 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2145 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2146 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2152 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2157 <table width='100%'>
2159 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2162 <table width='100%' align='center'>
2168 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2169 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2173 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2174 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2178 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2179 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2182 @userlist = sort ( @userlist );
2184 # If the password file contains entries, print entries and action icons
2186 if ( ! - z
" $userdb " ) {
2189 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2190 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2191 <td class='boldbase' colspan='2' align='center'> </td>
2196 foreach $line ( @userlist )
2200 @temp = split ( /:/ , $line );
2201 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2202 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2204 print "<tr bgcolor=' $color {'color20'}'> \n " ; }
2206 print "<tr bgcolor=' $color {'color22'}'> \n " ; }
2209 <td align='center'> $temp [0]</td>
2213 if ( $temp [ 1 ] eq 'standard' ) {
2214 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2215 } elsif ( $temp [ 1 ] eq 'extended' ) {
2216 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2217 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2218 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2221 <td width='8%' align='center'>
2222 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2223 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2224 <input type='hidden' name='ID' value=' $line ' />
2225 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2229 <td width='8%' align='center'>
2230 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2231 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2232 <input type='hidden' name='ID' value=' $temp [0]' />
2233 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2246 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2247 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2248 <td class='base'> $Lang ::tr{'edit'}</td>
2249 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2250 <td class='base'> $Lang ::tr{'remove'}</td>
2257 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2268 & Header
:: closebox
();
2272 # ===================================================================
2274 & Header
:: closebigbox
();
2276 & Header
:: closepage
();
2278 # -------------------------------------------------------------------
2282 if (- e
" $acl_src_subnets " ) {
2283 open ( FILE
, " $acl_src_subnets " );
2284 delete $proxysettings { 'SRC_SUBNETS' };
2285 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2288 if (- e
" $acl_src_banned_ip " ) {
2289 open ( FILE
, " $acl_src_banned_ip " );
2290 delete $proxysettings { 'SRC_BANNED_IP' };
2291 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2294 if (- e
" $acl_src_banned_mac " ) {
2295 open ( FILE
, " $acl_src_banned_mac " );
2296 delete $proxysettings { 'SRC_BANNED_MAC' };
2297 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2300 if (- e
" $acl_src_unrestricted_ip " ) {
2301 open ( FILE
, " $acl_src_unrestricted_ip " );
2302 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2303 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2306 if (- e
" $acl_src_unrestricted_mac " ) {
2307 open ( FILE
, " $acl_src_unrestricted_mac " );
2308 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2309 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2312 if (- e
" $acl_dst_nocache " ) {
2313 open ( FILE
, " $acl_dst_nocache " );
2314 delete $proxysettings { 'DST_NOCACHE' };
2315 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2318 if (- e
" $acl_dst_noauth " ) {
2319 open ( FILE
, " $acl_dst_noauth " );
2320 delete $proxysettings { 'DST_NOAUTH' };
2321 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2324 if (- e
" $acl_dst_noproxy_ip " ) {
2325 open ( FILE
, " $acl_dst_noproxy_ip " );
2326 delete $proxysettings { 'DST_NOPROXY_IP' };
2327 while (< FILE
>) { $proxysettings { 'DST_NOPROXY_IP' } .= $_ };
2330 if (- e
" $acl_dst_noproxy_url " ) {
2331 open ( FILE
, " $acl_dst_noproxy_url " );
2332 delete $proxysettings { 'DST_NOPROXY_URL' };
2333 while (< FILE
>) { $proxysettings { 'DST_NOPROXY_URL' } .= $_ };
2336 if (- e
" $acl_ports_safe " ) {
2337 open ( FILE
, " $acl_ports_safe " );
2338 delete $proxysettings { 'PORTS_SAFE' };
2339 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2342 if (- e
" $acl_ports_ssl " ) {
2343 open ( FILE
, " $acl_ports_ssl " );
2344 delete $proxysettings { 'PORTS_SSL' };
2345 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2348 if (- e
" $mimetypes " ) {
2349 open ( FILE
, " $mimetypes " );
2350 delete $proxysettings { 'MIME_TYPES' };
2351 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2354 if (- e
" $raddir /radauth.allowusers" ) {
2355 open ( FILE
, " $raddir /radauth.allowusers" );
2356 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2357 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2360 if (- e
" $raddir /radauth.denyusers" ) {
2361 open ( FILE
, " $raddir /radauth.denyusers" );
2362 delete $proxysettings { 'RADIUS_DENY_USERS' };
2363 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2366 if (- e
" $identdir /identauth.allowusers" ) {
2367 open ( FILE
, " $identdir /identauth.allowusers" );
2368 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2369 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2372 if (- e
" $identdir /identauth.denyusers" ) {
2373 open ( FILE
, " $identdir /identauth.denyusers" );
2374 delete $proxysettings { 'IDENT_DENY_USERS' };
2375 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2378 if (- e
" $identhosts " ) {
2379 open ( FILE
, " $identhosts " );
2380 delete $proxysettings { 'IDENT_HOSTS' };
2381 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2384 if (- e
" $cre_groups " ) {
2385 open ( FILE
, " $cre_groups " );
2386 delete $proxysettings { 'CRE_GROUPS' };
2387 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2390 if (- e
" $cre_svhosts " ) {
2391 open ( FILE
, " $cre_svhosts " );
2392 delete $proxysettings { 'CRE_SVHOSTS' };
2393 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2398 # -------------------------------------------------------------------
2402 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2403 undef $proxysettings { 'PORTS_SAFE' };
2406 s/^\s+//g ; s/\s+$//g ;
2410 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2412 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2413 @templist = split ( /-/ );
2414 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2415 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2419 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2420 undef $proxysettings { 'PORTS_SSL' };
2423 s/^\s+//g ; s/\s+$//g ;
2428 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2429 @templist = split ( /-/ );
2430 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2431 $proxysettings { 'PORTS_SSL' } .= $line . " \n " ;
2435 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2436 undef $proxysettings { 'DST_NOCACHE' };
2440 unless ( /^#/ ) { s/\s+//g ; }
2443 if ( /^\./ ) { $_ = '*' . $_ ; }
2444 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2448 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2449 undef $proxysettings { 'SRC_SUBNETS' };
2452 s/^\s+//g ; s/\s+$//g ;
2455 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2456 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2460 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2461 undef $proxysettings { 'SRC_BANNED_IP' };
2464 s/^\s+//g ; s/\s+$//g ;
2467 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2468 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2472 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2473 undef $proxysettings { 'SRC_BANNED_MAC' };
2476 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2479 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2480 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2484 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2485 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2488 s/^\s+//g ; s/\s+$//g ;
2491 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2492 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2496 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2497 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2500 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2503 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2504 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2508 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2509 undef $proxysettings { 'DST_NOAUTH' };
2513 unless ( /^#/ ) { s/\s+//g ; }
2516 if ( /^\./ ) { $_ = '*' . $_ ; }
2517 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2521 @temp = split ( /\n/ , $proxysettings { 'DST_NOPROXY_IP' });
2522 undef $proxysettings { 'DST_NOPROXY_IP' };
2525 s/^\s+//g ; s/\s+$//g ;
2528 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg wpad invalid ip or mask' }; }
2529 $proxysettings { 'DST_NOPROXY_IP' } .= $_ . " \n " ;
2533 @temp = split ( /\n/ , $proxysettings { 'DST_NOPROXY_URL' });
2534 undef $proxysettings { 'DST_NOPROXY_URL' };
2538 unless ( /^#/ ) { s/\s+//g ; }
2541 if ( /^\./ ) { $_ = '*' . $_ ; }
2542 $proxysettings { 'DST_NOPROXY_URL' } .= $_ . " \n " ;
2546 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2548 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2549 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2552 s/^\s+//g ; s/\s+$//g ;
2553 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2555 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2558 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2560 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2561 undef $proxysettings { 'NTLM_DENY_USERS' };
2564 s/^\s+//g ; s/\s+$//g ;
2565 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2567 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2570 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2572 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2573 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2576 s/^\s+//g ; s/\s+$//g ;
2577 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2579 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2582 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2584 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2585 undef $proxysettings { 'IDENT_DENY_USERS' };
2588 s/^\s+//g ; s/\s+$//g ;
2589 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2591 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2594 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2596 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2597 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2600 s/^\s+//g ; s/\s+$//g ;
2601 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2603 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2606 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2608 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2609 undef $proxysettings { 'RADIUS_DENY_USERS' };
2612 s/^\s+//g ; s/\s+$//g ;
2613 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2615 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2618 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2619 undef $proxysettings { 'IDENT_HOSTS' };
2622 s/^\s+//g ; s/\s+$//g ;
2625 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2626 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2630 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2631 undef $proxysettings { 'CRE_SVHOSTS' };
2634 s/^\s+//g ; s/\s+$//g ;
2637 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2638 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2643 # -------------------------------------------------------------------
2647 open ( FILE
, "> $acl_src_subnets " );
2649 if (! $proxysettings { 'SRC_SUBNETS' })
2651 print FILE
" $green_cidr \n " ;
2652 if ( $netsettings { 'BLUE_DEV' })
2654 print FILE
" $blue_cidr \n " ;
2656 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2659 open ( FILE
, "> $acl_src_banned_ip " );
2661 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2664 open ( FILE
, "> $acl_src_banned_mac " );
2666 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2669 open ( FILE
, "> $acl_src_unrestricted_ip " );
2671 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2674 open ( FILE
, "> $acl_src_unrestricted_mac " );
2676 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2679 open ( FILE
, "> $acl_dst_noauth " );
2681 print FILE
$proxysettings { 'DST_NOAUTH' };
2684 open ( FILE
, "> $acl_dst_noproxy_ip " );
2686 print FILE
$proxysettings { 'DST_NOPROXY_IP' };
2689 open ( FILE
, "> $acl_dst_noproxy_url " );
2691 print FILE
$proxysettings { 'DST_NOPROXY_URL' };
2694 open ( FILE
, "> $acl_dst_noauth_net " );
2696 open ( FILE
, "> $acl_dst_noauth_dom " );
2698 open ( FILE
, "> $acl_dst_noauth_url " );
2701 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2709 open ( FILE
, ">> $acl_dst_noauth_dom " );
2714 elsif (& General
:: validipormask
( $_ ))
2716 open ( FILE
, ">> $acl_dst_noauth_net " );
2721 elsif ( /\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?-\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/ )
2723 open ( FILE
, ">> $acl_dst_noauth_net " );
2730 open ( FILE
, ">> $acl_dst_noauth_url " );
2732 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2738 open ( FILE
, "> $acl_dst_nocache " );
2740 print FILE
$proxysettings { 'DST_NOCACHE' };
2743 open ( FILE
, "> $acl_dst_nocache_net " );
2745 open ( FILE
, "> $acl_dst_nocache_dom " );
2747 open ( FILE
, "> $acl_dst_nocache_url " );
2750 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2758 open ( FILE
, ">> $acl_dst_nocache_dom " );
2763 elsif (& General
:: validipormask
( $_ ))
2765 open ( FILE
, ">> $acl_dst_nocache_net " );
2770 elsif ( /\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?-\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/ )
2772 open ( FILE
, ">> $acl_dst_nocache_net " );
2779 open ( FILE
, ">> $acl_dst_nocache_url " );
2781 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2787 open ( FILE
, "> $acl_ports_safe " );
2789 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2792 open ( FILE
, "> $acl_ports_ssl " );
2794 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2797 if (- s
$throttled_urls )
2799 open ( URLFILE
, $throttled_urls );
2802 foreach ( @temp ) { print FILE
; }
2806 open ( FILE
, "> $mimetypes " );
2808 print FILE
$proxysettings { 'MIME_TYPES' };
2811 open ( FILE
, "> $raddir /radauth.allowusers" );
2813 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2816 open ( FILE
, "> $raddir /radauth.denyusers" );
2818 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2821 open ( FILE
, "> $identdir /identauth.allowusers" );
2823 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2826 open ( FILE
, "> $identdir /identauth.denyusers" );
2828 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2831 open ( FILE
, "> $identhosts " );
2833 print FILE
$proxysettings { 'IDENT_HOSTS' };
2836 open ( FILE
, "> $cre_groups " );
2838 print FILE
$proxysettings { 'CRE_GROUPS' };
2841 open ( FILE
, "> $cre_svhosts " );
2843 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2847 # -------------------------------------------------------------------
2851 open ( FILE
, ">/srv/web/ipfire/html/proxy.pac" );
2853 print FILE
"function FindProxyForURL(url, host) \n " ;
2855 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2859 (isPlainHostName(host)) ||
2860 (isInNet(host, "127.0.0.1", "255.0.0.0")) ||
2864 if ( $netsettings { 'GREEN_DEV' }) {
2865 print FILE
" (isInNet(host, \" $netsettings {'GREEN_NETADDRESS'} \" , \" $netsettings {'GREEN_NETMASK'} \" )) || \n " ;
2868 if (& Header
:: blue_used
() && $netsettings { 'BLUE_DEV' }) {
2869 print FILE
" (isInNet(host, \" $netsettings {'BLUE_NETADDRESS'} \" , \" $netsettings {'BLUE_NETMASK'} \" )) || \n " ;
2872 if (& Header
:: orange_used
() && $netsettings { 'ORANGE_DEV' }) {
2873 print FILE
" (isInNet(host, \" $netsettings {'ORANGE_NETADDRESS'} \" , \" $netsettings {'ORANGE_NETMASK'} \" )) || \n " ;
2876 # Additional exceptions for URLs
2877 # The file has to be created by the user and should contain one entry per line
2878 # Line-Format: <URL incl. wildcards>
2879 # e.g. *.ipfire.org*
2880 if (- s
" $acl_dst_noproxy_url " ) {
2883 open ( NOPROXY
, " $acl_dst_noproxy_url " );
2884 @templist = < NOPROXY
>;
2890 print FILE
" (shExpMatch(url, \" $_ \" )) || \n " ;
2894 # Additional exceptions for Subnets
2895 # The file has to be created by the user and should contain one entry per line
2896 # Line-Format: <IP>/<SUBNET MASK>
2897 # e.g. 192.168.0.0/255.255.255.0
2898 if (- s
" $acl_dst_noproxy_ip " ) {
2901 open ( NOPROXY
, " $acl_dst_noproxy_ip " );
2902 @templist = < NOPROXY
>;
2908 @temp = split ( /\/ /);
2909 print FILE
" (isInNet(host, \" $temp [0] \" , \" $temp [1] \" )) || \n " ;
2914 (isInNet(host, "169.254.0.0", "255.255.0.0"))
2922 if ( $proxysettings { 'ENABLE' } eq 'on' )
2924 print FILE
"if ( \n " ;
2925 print FILE
" (isInNet(myIpAddress(), \" $netsettings {'GREEN_NETADDRESS'} \" , \" $netsettings {'GREEN_NETMASK'} \" ))" ;
2928 if (- e
" $acl_src_subnets " ) {
2929 open ( SUBNETS
, " $acl_src_subnets " );
2930 @templist = < SUBNETS
>;
2936 @temp = split ( /\/ /);
2938 ( $temp [ 0 ] ne $netsettings { 'GREEN_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'GREEN_NETMASK' }) &&
2939 ( $temp [ 0 ] ne $netsettings { 'BLUE_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'BLUE_NETMASK' })
2943 print FILE
" || \n (isInNet(myIpAddress(), \" $temp [0] \" , \" $temp [1] \" ))" ;
2951 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2955 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2957 print FILE
" \n else \n\n " ;
2959 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2963 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2965 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2974 # -------------------------------------------------------------------
2981 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2982 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2983 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2984 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2986 $delaypools = 1 ; } else { $delaypools = 0 ;
2989 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2991 $authrealm = "IPFire Advanced Proxy Server" ;
2993 $authrealm = $proxysettings { 'AUTH_REALM' };
2996 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2997 my ( $remotehost , $remoteport ) = split ( /:/ , $_ );
2999 if ( $remoteport eq '' ) { $remoteport = 80 ; }
3001 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
3004 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
3005 # you make will be overwritten whenever you resave proxy settings using the
3008 # Instead, modify the file ' $acl_include ' and
3009 # then restart the proxy service using the web interface. Changes made to the
3010 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
3012 shutdown_lifetime 5 seconds
3018 # Include file with user defined settings.
3019 if (- e
"/etc/squid/squid.conf.pre.local" ) {
3020 print FILE
"include /etc/squid/squid.conf.pre.local \n\n " ;
3023 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
3024 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3027 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) {
3028 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'TRANSPARENT_PORT'} intercept" ;
3029 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3033 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3034 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
3035 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3038 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) {
3039 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'TRANSPARENT_PORT'} intercept" ;
3040 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3045 if (( $proxysettings { 'CACHE_SIZE' } > 0 ) || ( $proxysettings { 'CACHE_MEM' } > 0 ))
3049 if (!- z
$acl_dst_nocache_dom ) {
3050 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache_dom \"\n " ;
3051 print FILE
"cache deny no_cache_domains \n " ;
3053 if (!- z
$acl_dst_nocache_net ) {
3054 print FILE
"acl no_cache_ipaddr dst \" $acl_dst_nocache_net \"\n " ;
3055 print FILE
"cache deny no_cache_ipaddr \n " ;
3057 if (!- z
$acl_dst_nocache_url ) {
3058 print FILE
"acl no_cache_hosts url_regex -i \" $acl_dst_nocache_url \"\n " ;
3059 print FILE
"cache deny no_cache_hosts \n " ;
3065 cache_effective_user squid
3068 pid_filename /var/run/squid.pid
3070 cache_mem $proxysettings {'CACHE_MEM'} MB
3073 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
3075 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
3076 if ( $proxysettings { 'CACHE_DIGESTS' } eq 'on' ) { print FILE
"digest_generation on \n\n " ; } else { print FILE
"digest_generation off \n\n " ; }
3078 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
3080 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
3082 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
3084 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
3086 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
3091 open ( PORTS
, " $acl_ports_ssl " );
3092 my @ssl_ports = < PORTS
>;
3096 foreach ( @ssl_ports ) {
3097 print FILE
"acl SSL_ports port $_ " ;
3101 open ( PORTS
, " $acl_ports_safe " );
3102 my @safe_ports = < PORTS
>;
3106 foreach ( @safe_ports ) {
3107 print FILE
"acl Safe_ports port $_ " ;
3113 acl IPFire_http port $http_port
3114 acl IPFire_https port $https_port
3115 acl IPFire_ips dst $netsettings {'GREEN_ADDRESS'}
3116 acl IPFire_networks src " $acl_src_subnets "
3117 acl IPFire_servers dst " $acl_src_subnets "
3118 acl IPFire_green_network src $green_cidr
3119 acl IPFire_green_servers dst $green_cidr
3122 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_network src $blue_cidr \n " ; }
3123 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_servers dst $blue_cidr \n " ; }
3124 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPFire_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3125 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPFire_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3126 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPFire_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3127 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPFire_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3129 acl CONNECT method CONNECT
3133 if ( $proxysettings { 'CACHE_SIZE' } > 0 ) {
3135 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3136 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3138 cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256
3142 if ( $proxysettings { 'CACHE_MEM' } > 0 ) {
3143 # always 2% of CACHE_MEM defined as max object size
3144 print FILE
"maximum_object_size_in_memory " . int ( $proxysettings { 'CACHE_MEM' } * 1024 * 0.02 ) . " KB \n\n " ;
3146 print FILE
"cache deny all \n\n " ;
3151 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3155 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3156 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size none IPFire_unrestricted_ips \n " ; }
3157 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size none IPFire_unrestricted_mac \n " ; }
3158 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3160 if (!- z
$extgrp ) { print FILE
"reply_body_max_size none for_extended_users \n " ; }
3164 if ( $proxysettings { 'MAX_INCOMING_SIZE' } != '0' )
3166 print FILE
"reply_body_max_size $proxysettings {'MAX_INCOMING_SIZE'} KB all \n\n " ;
3169 if ( $proxysettings { 'LOGGING' } eq 'on' )
3172 access_log stdio:/var/log/squid/access.log
3173 cache_log /var/log/squid/cache.log
3174 cache_store_log none
3177 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"access_log stdio:\/var\/log\/squid\/user_agent.log useragent \n " ; }
3178 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
3181 access_log /dev/null
3183 cache_store_log none
3192 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
3194 print FILE
"forwarded_for on \n " ;
3196 print FILE
"forwarded_for off \n " ;
3198 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
3200 print FILE
"via on \n " ;
3202 print FILE
"via off \n " ;
3206 # If we use authentication, users must always authenticate
3207 unless ( $proxysettings { "AUTH_METHOD" } eq "" ) {
3208 print FILE
"authenticate_ip_ttl 0 \n\n " ;
3211 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3213 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3215 print FILE
"auth_param basic program $authdir /basic_ncsa_auth $userdb \n " ;
3216 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3217 print FILE
"auth_param basic realm $authrealm \n " ;
3218 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3221 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
3223 print FILE
"auth_param basic utf8 on \n " ;
3224 print FILE
"auth_param basic program $authdir /basic_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
3225 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
3226 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
3227 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
3229 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3231 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
3233 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3235 print FILE
" -u sAMAccountName -P" ;
3237 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
3239 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3241 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
3243 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
3245 print FILE
" -u cn -P" ;
3247 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
3249 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3251 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
3253 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3255 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
3256 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
3257 print FILE
" -u uid -P" ;
3259 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
3260 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3261 print FILE
"auth_param basic realm $authrealm \n " ;
3262 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3265 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm-auth' )
3267 print FILE
"auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp" ;
3268 if ( $proxysettings { 'NTLM_AUTH_GROUP' }) {
3269 my $ntlm_auth_group = $proxysettings { 'NTLM_AUTH_GROUP' };
3270 $ntlm_auth_group =~ s/\\/\+/ ;
3272 print FILE
" --require-membership-of= $ntlm_auth_group " ;
3276 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n\n " ;
3277 print FILE
"auth_param ntlm credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n\n " ;
3279 # BASIC authentication
3280 if ( $proxysettings { 'NTLM_AUTH_BASIC' } eq "on" ) {
3281 print FILE
"auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic" ;
3282 if ( $proxysettings { 'NTLM_AUTH_GROUP' }) {
3283 my $ntlm_auth_group = $proxysettings { 'NTLM_AUTH_GROUP' };
3284 $ntlm_auth_group =~ s/\\/\+/ ;
3286 print FILE
" --require-membership-of= $ntlm_auth_group " ;
3289 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3290 print FILE
"auth_param basic realm $authrealm \n " ;
3291 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n\n " ;
3295 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3297 print FILE
"auth_param basic program $authdir /basic_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3298 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3299 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3300 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3301 print FILE
"auth_param basic realm $authrealm \n " ;
3302 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3306 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3307 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3309 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3311 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3313 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3315 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3318 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3321 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3322 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3324 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3327 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3328 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3329 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3334 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3336 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3338 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3340 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3342 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3344 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3346 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3348 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3351 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3352 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3353 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3357 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3359 print FILE
"acl within_timeframe time " ;
3360 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3361 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3362 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3363 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3364 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3365 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3366 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3367 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3368 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3369 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3370 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3372 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3373 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3376 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3379 #Classroom extensions
3380 acl IPFire_no_access_ips src " $acl_src_noaccess_ip "
3381 acl IPFire_no_access_mac arp " $acl_src_noaccess_mac "
3384 print FILE
"deny_info " ;
3385 if (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ))
3387 print FILE
"ERR_ACCESS_DISABLED" ;
3389 print FILE
"ERR_ACCESS_DENIED" ;
3391 print FILE
" IPFire_no_access_ips \n " ;
3392 print FILE
"deny_info " ;
3393 if (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ))
3395 print FILE
"ERR_ACCESS_DISABLED" ;
3397 print FILE
"ERR_ACCESS_DENIED" ;
3399 print FILE
" IPFire_no_access_mac \n " ;
3402 http_access deny IPFire_no_access_ips
3403 http_access deny IPFire_no_access_mac
3408 #Insert acl file and replace __VAR__ with correct values
3409 my $blue_net = '' ; #BLUE empty by default
3411 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3412 $blue_net = " $blue_cidr " ;
3413 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3415 if (!- z
$acl_include )
3417 open ( ACL
, " $acl_include " );
3418 print FILE
" \n #Start of custom includes \n\n " ;
3420 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3421 $_ =~ s/__GREEN_NET__/$green_cidr/ ;
3422 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3423 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3424 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3427 print FILE
" \n #End of custom includes \n " ;
3430 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3432 # Check if squidclamav is enabled.
3433 if ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ) {
3434 print FILE
" \n #Settings for squidclamav: \n " ;
3435 print FILE
"http_port 127.0.0.1: $proxysettings {'PROXY_PORT'} \n " ;
3436 print FILE
"acl purge method PURGE \n " ;
3437 print FILE
"http_access deny to_localhost \n " ;
3438 print FILE
"http_access allow localhost \n " ;
3439 print FILE
"http_access allow purge localhost \n " ;
3440 print FILE
"http_access deny purge \n " ;
3441 print FILE
"url_rewrite_access deny localhost \n " ;
3446 #local machine, no restriction
3447 http_access allow localhost
3449 #GUI admin if local machine connects
3450 http_access allow IPFire_ips IPFire_networks IPFire_http
3451 http_access allow CONNECT IPFire_ips IPFire_networks IPFire_https
3453 #Deny not web services
3457 print FILE
"http_access deny !Safe_ports \n " ;
3461 print FILE
"http_access deny CONNECT !SSL_ports \n " ;
3464 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3466 print FILE
"#Set ident ACLs \n " ;
3467 if (!- z
$identhosts )
3469 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3470 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3471 print FILE
"ident_lookup_access deny all \n " ;
3473 print FILE
"ident_lookup_access allow all \n " ;
3475 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3479 print FILE
"#Set download throttling \n " ;
3481 if ( $netsettings { 'BLUE_DEV' })
3483 print FILE
"delay_pools 2 \n " ;
3485 print FILE
"delay_pools 1 \n " ;
3488 print FILE
"delay_class 1 3 \n " ;
3489 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3491 print FILE
"delay_parameters 1 " ;
3492 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3496 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3498 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3501 print FILE
" -1/-1 " ;
3502 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3506 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3508 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3512 if ( $netsettings { 'BLUE_DEV' })
3514 print FILE
"delay_parameters 2 " ;
3515 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3519 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3521 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3523 print FILE
" -1/-1 " ;
3524 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3528 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3530 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3535 print FILE
"delay_access 1 deny IPFire_ips \n " ;
3536 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPFire_unrestricted_ips \n " ; }
3537 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPFire_unrestricted_mac \n " ; }
3538 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3540 if ( $netsettings { 'BLUE_DEV' })
3542 print FILE
"delay_access 1 allow IPFire_green_network" ;
3543 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3545 print FILE
"delay_access 1 deny all \n " ;
3547 print FILE
"delay_access 1 allow all" ;
3548 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3552 if ( $netsettings { 'BLUE_DEV' })
3554 print FILE
"delay_access 2 deny IPFire_ips \n " ;
3555 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPFire_unrestricted_ips \n " ; }
3556 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPFire_unrestricted_mac \n " ; }
3557 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3558 print FILE
"delay_access 2 allow IPFire_blue_network" ;
3559 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3561 print FILE
"delay_access 2 deny all \n " ;
3564 print FILE
"delay_initial_bucket_level 100 \n " ;
3568 if ( $proxysettings { 'NO_PROXY_LOCAL' } eq 'on' )
3570 print FILE
"#Prevent internal proxy access to Green except IPFire itself \n " ;
3571 print FILE
"http_access deny IPFire_green_servers !IPFire_ips !IPFire_green_network \n\n " ;
3574 if ( $proxysettings { 'NO_PROXY_LOCAL_BLUE' } eq 'on' )
3576 print FILE
"#Prevent internal proxy access from Blue except IPFire itself \n " ;
3577 print FILE
"http_access allow IPFire_blue_network IPFire_blue_servers \n " ;
3578 print FILE
"http_access deny IPFire_blue_network !IPFire_ips IPFire_servers \n\n " ;
3582 #Set custom configured ACLs
3585 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPFire_banned_ips \n " ; }
3586 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPFire_banned_mac \n " ; }
3588 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3590 if (!- z
$acl_src_unrestricted_ip )
3592 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_ips to_ipaddr_without_auth \n " ; }
3593 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_ips to_domains_without_auth \n " ; }
3594 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_ips to_hosts_without_auth \n " ; }
3596 if (!- z
$acl_src_unrestricted_mac )
3598 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_mac to_ipaddr_without_auth \n " ; }
3599 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_mac to_domains_without_auth \n " ; }
3600 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_mac to_hosts_without_auth \n " ; }
3602 if (!- z
$acl_dst_noauth_net )
3604 print FILE
"http_access allow IPFire_networks" ;
3605 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3606 print FILE
" !within_timeframe" ;
3608 print FILE
" within_timeframe" ; }
3609 print FILE
" to_ipaddr_without_auth \n " ;
3611 if (!- z
$acl_dst_noauth_dom )
3613 print FILE
"http_access allow IPFire_networks" ;
3614 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3615 print FILE
" !within_timeframe" ;
3617 print FILE
" within_timeframe" ; }
3618 print FILE
" to_domains_without_auth \n " ;
3620 if (!- z
$acl_dst_noauth_url )
3622 print FILE
"http_access allow IPFire_networks" ;
3623 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3624 print FILE
" !within_timeframe" ;
3626 print FILE
" within_timeframe" ; }
3627 print FILE
" to_hosts_without_auth \n " ;
3631 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3633 print FILE
"http_access deny !for_inetusers" ;
3634 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3639 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3640 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3641 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3642 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3643 (!- z
" $identdir /identauth.denyusers" )
3646 print FILE
"http_access deny for_acl_users" ;
3647 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3651 if (!- z
$acl_src_unrestricted_ip )
3653 print FILE
"http_access allow IPFire_unrestricted_ips" ;
3654 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3656 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3658 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3660 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3662 print FILE
" for_inetusers" ;
3664 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3666 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3668 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3670 print FILE
" for_acl_users" ;
3672 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3674 print FILE
" !for_acl_users" ;
3676 } else { print FILE
" for_inetusers" ; }
3682 if (!- z
$acl_src_unrestricted_mac )
3684 print FILE
"http_access allow IPFire_unrestricted_mac" ;
3685 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3687 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3689 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3691 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3693 print FILE
" for_inetusers" ;
3695 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3697 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3699 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3701 print FILE
" for_acl_users" ;
3703 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3705 print FILE
" !for_acl_users" ;
3707 } else { print FILE
" for_inetusers" ; }
3713 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3715 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3716 if (!- z
$extgrp ) { print FILE
"http_access allow IPFire_networks for_extended_users \n " ; }
3721 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3722 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3723 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3724 (!- z
" $raddir /radauth.denyusers" )
3728 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3729 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3730 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3731 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3732 (!- z
" $identdir /identauth.denyusers" )
3736 print FILE
"http_access deny for_acl_users" ;
3737 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3741 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3743 print FILE
"http_access allow" ;
3744 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3745 print FILE
" !within_timeframe" ;
3747 print FILE
" within_timeframe" ; }
3748 print FILE
" !on_ident_aware_hosts \n " ;
3751 print FILE
"http_access allow IPFire_networks" ;
3754 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3755 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3756 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3757 (!- z
" $raddir /radauth.allowusers" )
3761 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3762 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3763 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3764 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3765 (!- z
" $identdir /identauth.allowusers" )
3769 print FILE
" for_acl_users" ;
3770 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3771 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3772 print FILE
" for_inetusers" ;
3774 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3776 print FILE
" !concurrent" ;
3778 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3779 print FILE
" !within_timeframe" ;
3781 print FILE
" within_timeframe" ; }
3784 print FILE
"http_access deny all \n\n " ;
3786 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3787 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3789 print FILE
"#Strip HTTP Header \n " ;
3791 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3793 print FILE
"request_header_access X-Forwarded-For deny all \n " ;
3794 print FILE
"reply_header_access X-Forwarded-For deny all \n " ;
3796 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3798 print FILE
"request_header_access Via deny all \n " ;
3799 print FILE
"reply_header_access Via deny all \n " ;
3801 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3803 print FILE
"request_header_access User-Agent deny all \n " ;
3804 print FILE
"reply_header_access User-Agent deny all \n " ;
3806 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3808 print FILE
"request_header_access Referer deny all \n " ;
3809 print FILE
"reply_header_access Referer deny all \n " ;
3814 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3816 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3818 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3820 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3822 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3828 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3830 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3831 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPFire_unrestricted_ips \n " ; }
3832 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPFire_unrestricted_mac \n " ; }
3833 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3835 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3837 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3838 print FILE
"http_reply_access allow all \n\n " ;
3841 print FILE
"visible_hostname" ;
3842 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3844 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3846 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3849 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n " ; }
3850 if (!( $proxysettings { 'ADMIN_PASSWORD' } eq '' )) { print FILE
"cachemgr_passwd $proxysettings {'ADMIN_PASSWORD'} all \n " ; }
3853 print FILE
"max_filedescriptors $proxysettings {'FILEDESCRIPTORS'} \n\n " ;
3855 # Write the parent proxy info, if needed.
3856 if ( $remotehost ne '' )
3858 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3860 # Enter authentication for the parent cache. Option format is
3861 # login=user:password ($proxy1='YES')
3862 # login=PASS ($proxy1='PASS')
3863 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3864 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3866 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3867 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3869 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3871 print FILE
" \n always_direct allow IPFire_ips \n " ;
3872 print FILE
"never_direct allow all \n\n " ;
3874 if (( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) || ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ) || ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ))
3876 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3877 print FILE
"url_rewrite_children " , & General
:: number_cpu_cores
();
3878 print FILE
" startup=" , & General
:: number_cpu_cores
();
3879 print FILE
" idle=" , & General
:: number_cpu_cores
();
3880 print FILE
" queue-size=" , & General
:: number_cpu_cores
() * 32 , " \n\n " ;
3883 # Include file with user defined settings.
3884 if (- e
"/etc/squid/squid.conf.local" ) {
3885 print FILE
"include /etc/squid/squid.conf.local \n " ;
3889 # Proxy settings for squidclamav - if installed.
3891 # Check if squidclamav is enabled.
3892 if ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ) {
3894 my $configfile = '/etc/squidclamav.conf' ;
3896 my $data = & General
:: read_file_utf8
( $configfile );
3897 $data =~ s/squid_port [0-9]+/squid_port $proxysettings{'PROXY_PORT'}/g ;
3898 & General
:: write_file_utf8
( $configfile , $data );
3902 # -------------------------------------------------------------------
3906 my ( $str_user , $str_pass , $str_group ) = @_ ;
3907 my @groupmembers =();
3909 if ( $str_pass eq 'lEaVeAlOnE' )
3911 open ( FILE
, " $userdb " );
3912 @groupmembers = < FILE
>;
3914 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3915 & deluser
( $str_user );
3916 open ( FILE
, ">> $userdb " );
3918 print FILE
" $str_user $str_pass " ;
3921 & deluser
( $str_user );
3923 my $htpasswd = new Apache
:: Htpasswd
( " $userdb " );
3924 $htpasswd -> htpasswd ( $str_user , $str_pass );
3927 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3928 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3929 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3931 print FILE
" $str_user \n " ;
3937 # -------------------------------------------------------------------
3941 my ( $str_user ) = @_ ;
3943 my @groupmembers =();
3946 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3949 open ( FILE
, " $groupfile " );
3950 @groupmembers = < FILE
>;
3952 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3953 open ( FILE
, "> $groupfile " );
3955 print FILE
@templist ;
3960 open ( FILE
, " $userdb " );
3961 @groupmembers = < FILE
>;
3963 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3964 open ( FILE
, "> $userdb " );
3966 print FILE
@templist ;
3972 # -------------------------------------------------------------------
3976 open ( FILE
, ">${General::swroot}/proxy/cachemgr.conf" );
3978 print FILE
" $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'} \n " ;
3979 print FILE
"localhost" ;
3984 # -------------------------------------------------------------------