]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/proxy.cgi
3 # (c) 2004-2007 marco.s - http://www.advproxy.net
5 # This code is distributed under the terms of the GPL
7 # $Id: advproxy.cgi,v 2.1.0 2007/03/06 00:00:00 marco.s Exp $
12 # enable only the following on debugging purpose
14 use CGI
:: Carp
'fatalsToBrowser' ;
16 require '/var/ipfire/general-functions.pl' ;
17 require "${General::swroot}/lang.pl" ;
18 require "${General::swroot}/header.pl" ;
20 my @squidversion = `/usr/sbin/squid -v` ;
26 my %filtersettings =();
27 my %xlratorsettings =();
28 my %stdproxysettings =();
34 my @throttle_limits =( 64 , 128 , 256 , 384 , 512 , 1024 , 2048 , 3072 , 5120 );
35 my $throttle_binary = "bin|cab|exe|gz|rar|sea|tar|tgz|zip" ;
36 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi" ;
37 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|qt|ra?m" ;
39 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 " ;
40 my $def_ports_ssl = "443 # https \n 563 # snews \n " ;
45 my $hintcolour = '#FFFFCC' ;
46 my $ncsa_buttontext = '' ;
61 my $replybodymaxsize = 0 ;
62 my $browser_regexp = '' ;
66 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
67 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
68 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
69 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
70 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
71 my $credir = "${General::swroot}/proxy/advanced/cre" ;
73 my $userdb = " $ncsadir /passwd" ;
74 my $stdgrp = " $ncsadir /standard.grp" ;
75 my $extgrp = " $ncsadir /extended.grp" ;
76 my $disgrp = " $ncsadir /disabled.grp" ;
78 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
79 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
80 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
82 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
83 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
84 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
86 my $identhosts = " $identdir /hosts" ;
88 my $authdir = "/usr/lib/squid/auth" ;
89 my $errordir = "/usr/lib/squid/errors" ;
91 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
92 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
93 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
94 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
95 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
96 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
97 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
98 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
99 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
100 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
101 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
102 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
103 my $acl_include = " $acldir /include.acl" ;
105 my $updaccelversion = 'n/a' ;
106 my $urlfilterversion = 'n/a' ;
108 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
109 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
110 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
111 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
112 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
113 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
115 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
116 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
118 unless (- e
$userdb ) { system ( "touch $userdb " ); }
119 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
120 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
121 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
123 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
124 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
125 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
126 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
127 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
128 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
129 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
130 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
131 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
132 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
133 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
134 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
135 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
137 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
138 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
140 open FILE
, $browserdb ;
141 @useragentlist = sort { reverse ( substr ( reverse ( substr ( $a , index ( $a , ',' )+ 1 )), index ( reverse ( substr ( $a , index ( $a , ',' ))), ',' )+ 1 )) cmp reverse ( substr ( reverse ( substr ( $b , index ( $b , ',' )+ 1 )), index ( reverse ( substr ( $b , index ( $b , ',' ))), ',' )+ 1 ))} grep ! /(^$)|(^\s*#)/ ,< FILE
>;
144 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
145 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
147 $filtersettings { 'CHILDREN' } = '5' ;
148 if (- e
"${General::swroot}/urlfilter/settings" ) {
149 & General
:: readhash
( "${General::swroot}/urlfilter/settings" , \
%filtersettings );
152 $xlratorsettings { 'CHILDREN' } = '5' ;
153 if (- e
"${General::swroot}/updatexlrator/settings" ) {
154 & General
:: readhash
( "${General::swroot}/updatexlrator/settings" , \
%xlratorsettings );
157 & Header
:: showhttpheaders
();
159 $proxysettings { 'ACTION' } = '' ;
160 $proxysettings { 'VALID' } = '' ;
162 $proxysettings { 'ENABLE' } = 'off' ;
163 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
164 $proxysettings { 'TRANSPARENT' } = 'off' ;
165 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
166 $proxysettings { 'PROXY_PORT' } = '800' ;
167 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
168 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
169 $proxysettings { 'ERR_LANGUAGE' } = 'German' ;
170 $proxysettings { 'ERR_DESIGN' } = 'ipfire' ;
171 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
172 $proxysettings { 'FORWARD_VIA' } = 'off' ;
173 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
174 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
175 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
176 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
177 $proxysettings { 'UPSTREAM_USER' } = '' ;
178 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
179 $proxysettings { 'LOGGING' } = 'off' ;
180 $proxysettings { 'LOGQUERY' } = 'off' ;
181 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
182 $proxysettings { 'CACHE_MEM' } = '2' ;
183 $proxysettings { 'CACHE_SIZE' } = '50' ;
184 $proxysettings { 'MAX_SIZE' } = '4096' ;
185 $proxysettings { 'MIN_SIZE' } = '0' ;
186 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
187 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
188 $proxysettings { 'L1_DIRS' } = '16' ;
189 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
190 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
191 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
192 $proxysettings { 'NO_PROXY_LOCAL' } = 'off' ;
193 $proxysettings { 'NO_PROXY_LOCAL_BLUE' } = 'off' ;
194 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
195 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
196 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
197 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
198 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
199 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
200 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
201 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
202 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
203 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
204 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
205 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
206 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
207 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
208 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
209 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
210 $proxysettings { 'FAKE_USERAGENT' } = '' ;
211 $proxysettings { 'FAKE_REFERER' } = '' ;
212 $proxysettings { 'AUTH_METHOD' } = 'none' ;
213 $proxysettings { 'AUTH_REALM' } = '' ;
214 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
215 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
216 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
217 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
218 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
219 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
220 $proxysettings { 'NCSA_USERNAME' } = '' ;
221 $proxysettings { 'NCSA_GROUP' } = '' ;
222 $proxysettings { 'NCSA_PASS' } = '' ;
223 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
224 $proxysettings { 'LDAP_BASEDN' } = '' ;
225 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
226 $proxysettings { 'LDAP_SERVER' } = '' ;
227 $proxysettings { 'LDAP_PORT' } = '389' ;
228 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
229 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
230 $proxysettings { 'LDAP_GROUP' } = '' ;
231 $proxysettings { 'NTLM_DOMAIN' } = '' ;
232 $proxysettings { 'NTLM_PDC' } = '' ;
233 $proxysettings { 'NTLM_BDC' } = '' ;
234 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
235 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
236 $proxysettings { 'RADIUS_SERVER' } = '' ;
237 $proxysettings { 'RADIUS_PORT' } = '1812' ;
238 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
239 $proxysettings { 'RADIUS_SECRET' } = '' ;
240 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
241 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
242 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
243 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
244 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
245 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
246 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
247 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
249 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
251 & Header
:: getcgihash
( \
%proxysettings );
253 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
254 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
255 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
256 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
258 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
260 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
263 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
265 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
266 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
267 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
269 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
270 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
272 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
273 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
275 if (! $errormessage ) {
276 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
277 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
279 $proxysettings { 'NCSA_USERNAME' } = '' ;
280 $proxysettings { 'NCSA_GROUP' } = '' ;
281 $proxysettings { 'NCSA_PASS' } = '' ;
282 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
285 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
287 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
288 & deluser
( $proxysettings { 'ID' });
291 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
292 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
293 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
295 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
297 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
298 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
299 @temp = split ( /:/ , $proxysettings { 'ID' });
300 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
301 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
302 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
303 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
306 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }))
308 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
309 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
310 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
311 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
312 $errormessage = $Lang :: tr
{ 'invalid input' };
315 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
317 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
320 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
321 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
323 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
326 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
327 ( $proxysettings { 'CACHE_MEM' } < 1 ))
329 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
332 my @free = `/usr/bin/free` ;
333 $free [ 1 ] =~ m/(\d+)/ ;
334 $cachemem = int $1 / 2048 ;
335 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
336 $proxysettings { 'CACHE_MEM' } = $cachemem ;
338 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
340 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
343 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
345 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
348 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
350 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
353 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
355 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
358 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
360 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
363 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
365 $browser_regexp = '' ;
366 foreach ( @useragentlist )
369 @useragent = split ( /,/ );
370 if ( $proxysettings { 'UA_' . @useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " @useragent [2]|" ; }
372 chop ( $browser_regexp );
373 if (! $browser_regexp )
375 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
379 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
381 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
382 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
383 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
385 if ( $netsettings { 'BLUE_DEV' })
387 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
388 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
390 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
394 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
396 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
401 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
402 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
404 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
407 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
409 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
412 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
414 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
417 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
419 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
422 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
424 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
428 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
430 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
432 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
436 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
438 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
440 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
444 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
446 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
448 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
451 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
453 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
456 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
458 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
461 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
463 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
465 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
470 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
472 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
474 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
477 if ( $proxysettings { 'NTLM_PDC' } eq '' )
479 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
482 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
484 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
487 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
489 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
493 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
495 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
497 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
500 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
502 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
505 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
507 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
512 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
515 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
516 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
517 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
518 if (( $proxy1 ne $proxy2 ))
520 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
528 $proxysettings { 'VALID' } = 'no' ; }
530 $proxysettings { 'VALID' } = 'yes' ; }
532 if ( $proxysettings { 'VALID' } eq 'yes' )
536 delete $proxysettings { 'SRC_SUBNETS' };
537 delete $proxysettings { 'SRC_BANNED_IP' };
538 delete $proxysettings { 'SRC_BANNED_MAC' };
539 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
540 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
541 delete $proxysettings { 'DST_NOCACHE' };
542 delete $proxysettings { 'DST_NOAUTH' };
543 delete $proxysettings { 'PORTS_SAFE' };
544 delete $proxysettings { 'PORTS_SSL' };
545 delete $proxysettings { 'MIME_TYPES' };
546 delete $proxysettings { 'NTLM_ALLOW_USERS' };
547 delete $proxysettings { 'NTLM_DENY_USERS' };
548 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
549 delete $proxysettings { 'RADIUS_DENY_USERS' };
550 delete $proxysettings { 'IDENT_HOSTS' };
551 delete $proxysettings { 'IDENT_ALLOW_USERS' };
552 delete $proxysettings { 'IDENT_DENY_USERS' };
554 delete $proxysettings { 'CRE_GROUPS' };
555 delete $proxysettings { 'CRE_SVHOSTS' };
557 delete $proxysettings { 'NCSA_USERNAME' };
558 delete $proxysettings { 'NCSA_GROUP' };
559 delete $proxysettings { 'NCSA_PASS' };
560 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
562 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
563 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
564 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
565 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
566 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
567 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
568 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
570 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
571 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
573 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
575 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
576 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
577 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
578 $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' };
579 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
584 system ( '/usr/local/bin/squidctrl' , 'disable' );
585 unlink "${General::swroot}/proxy/enable" ;
586 unlink "${General::swroot}/proxy/transparent" ;
587 unlink "${General::swroot}/proxy/enable_blue" ;
588 unlink "${General::swroot}/proxy/transparent_blue" ;
590 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
591 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable" );
592 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
593 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) {
594 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent" ); }
595 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
596 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable_blue" );
597 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
598 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) {
599 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
601 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/squidctrl restart >/dev/null 2>&1' ); }
605 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
607 system ( '/usr/local/bin/squidctrl flush >/dev/null 2>&1' );
612 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
613 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
614 } elsif (- e
"${General::swroot}/proxy/settings" ) {
615 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
620 $checked { 'ENABLE' }{ 'off' } = '' ;
621 $checked { 'ENABLE' }{ 'on' } = '' ;
622 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
624 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
625 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
626 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
628 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
629 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
630 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
632 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
633 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
634 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
636 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
637 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
638 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
640 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
641 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
642 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
643 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
644 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
645 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
646 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
647 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
648 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
649 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
650 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
651 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
653 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
654 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
655 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
656 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
657 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
658 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
660 $checked { 'LOGGING' }{ 'off' } = '' ;
661 $checked { 'LOGGING' }{ 'on' } = '' ;
662 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
663 $checked { 'LOGQUERY' }{ 'off' } = '' ;
664 $checked { 'LOGQUERY' }{ 'on' } = '' ;
665 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
666 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
667 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
668 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
670 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
671 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
673 $checked { 'NO_PROXY_LOCAL' }{ 'off' } = '' ;
674 $checked { 'NO_PROXY_LOCAL' }{ 'on' } = '' ;
675 $checked { 'NO_PROXY_LOCAL' }{ $proxysettings { 'NO_PROXY_LOCAL' }} = "checked='checked'" ;
676 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'off' } = '' ;
677 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'on' } = '' ;
678 $checked { 'NO_PROXY_LOCAL_BLUE' }{ $proxysettings { 'NO_PROXY_LOCAL_BLUE' }} = "checked='checked'" ;
680 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
681 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
682 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
684 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
685 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
686 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
687 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
688 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
690 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
691 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
692 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
693 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
694 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
695 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
696 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
698 $checked { 'TIME_MON' }{ 'off' } = '' ;
699 $checked { 'TIME_MON' }{ 'on' } = '' ;
700 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
701 $checked { 'TIME_TUE' }{ 'off' } = '' ;
702 $checked { 'TIME_TUE' }{ 'on' } = '' ;
703 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
704 $checked { 'TIME_WED' }{ 'off' } = '' ;
705 $checked { 'TIME_WED' }{ 'on' } = '' ;
706 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
707 $checked { 'TIME_THU' }{ 'off' } = '' ;
708 $checked { 'TIME_THU' }{ 'on' } = '' ;
709 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
710 $checked { 'TIME_FRI' }{ 'off' } = '' ;
711 $checked { 'TIME_FRI' }{ 'on' } = '' ;
712 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
713 $checked { 'TIME_SAT' }{ 'off' } = '' ;
714 $checked { 'TIME_SAT' }{ 'on' } = '' ;
715 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
716 $checked { 'TIME_SUN' }{ 'off' } = '' ;
717 $checked { 'TIME_SUN' }{ 'on' } = '' ;
718 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
720 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
721 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
722 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
723 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
725 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
726 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
727 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
728 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
729 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
730 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
731 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
732 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
733 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
735 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
736 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
737 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
739 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
740 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
741 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
743 foreach ( @useragentlist ) {
744 @useragent = split ( /,/ );
745 $checked { 'UA_' . @useragent [ 0 ]}{ 'off' } = '' ;
746 $checked { 'UA_' . @useragent [ 0 ]}{ 'on' } = '' ;
747 $checked { 'UA_' . @useragent [ 0 ]}{ $proxysettings { 'UA_' . @useragent [ 0 ]}} = "checked='checked'" ;
750 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
751 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
752 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
753 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
754 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
755 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
756 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
758 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
760 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
761 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
762 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
764 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
765 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
766 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
768 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
770 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
772 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
774 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
775 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
776 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
778 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
779 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
780 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
782 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
783 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
784 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
786 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
787 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
788 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
790 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
791 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
792 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
794 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
795 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
796 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
798 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
799 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
800 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
802 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
803 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
804 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
806 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
807 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
808 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
810 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
811 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
812 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
814 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
816 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
819 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
820 print "<font class='base'> $errormessage </font> \n " ;
824 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
826 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
827 $squidversion [ 0 ] =~ s/^\s+//g ;
828 $squidversion [ 0 ] =~ s/\s+$//g ;
830 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
833 # ===================================================================
835 # ===================================================================
837 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
839 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
841 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
846 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
849 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
850 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
851 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
852 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
855 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
856 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
857 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
858 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
863 if ( $netsettings { 'BLUE_DEV' }) {
864 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
865 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
867 print "<td colspan='2'> </td>" ;
870 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
871 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
876 if ( $netsettings { 'BLUE_DEV' }) {
877 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
878 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
880 print "<td colspan='2'> </td>" ;
883 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
885 $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}
886 <select name='ERR_LANGUAGE'>
889 foreach (< $errordir /*>) {
891 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
892 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
900 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
901 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
902 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
903 <td class='base'><select name='ERR_DESIGN'>
904 <option value='ipfire' $selected {'ERR_DESIGN'}{'ipfire'}>IPFire</option>
905 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
909 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
910 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
918 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
921 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}:</td>
922 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
923 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'} <img src='/blob.gif' alt='*' /></td>
924 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
927 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td>
928 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
929 <td class='base'> $Lang ::tr{'advproxy upstream username'}: <img src='/blob.gif' alt='*' /></td>
930 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
933 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td>
934 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
935 <td class='base'> $Lang ::tr{'advproxy upstream password'}: <img src='/blob.gif' alt='*' /></td>
936 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
939 <td class='base'> $Lang ::tr{'advproxy no connection auth'}:</td>
940 <td><input type='checkbox' name='NO_CONNECTION_AUTH' $checked {'NO_CONNECTION_AUTH'}{'on'} /></td>
948 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
951 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
952 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
953 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
954 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
959 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
960 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
966 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
969 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
972 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
973 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
974 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
975 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
978 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
979 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
980 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
981 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
984 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
985 <td class='base'><select name='L1_DIRS'>
986 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
987 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
988 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
989 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
990 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
992 <td colspan='2' rowspan= '5' valign='top' class='base'>
993 <table cellspacing='0' cellpadding='0'>
995 <!-- intentionally left empty -->
998 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
1001 <!-- intentionally left empty -->
1004 <!-- intentionally left empty -->
1007 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1011 print $proxysettings { 'DST_NOCACHE' };
1020 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1021 <td class='base'><select name='MEM_POLICY'>
1022 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1023 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1024 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1025 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1029 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1030 <td class='base'><select name='CACHE_POLICY'>
1031 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1032 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1033 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1034 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1038 <td colspan='2'> </td>
1041 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1042 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1046 <table width='100%'>
1048 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1051 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1054 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}:</td>
1055 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}:</td>
1058 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1061 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1065 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1068 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1075 <table width='100%'>
1077 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1080 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1083 <td colspan='4' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1086 <td colspan='2' rowspan='4'><textarea name='SRC_SUBNETS' cols='32' rows='6' wrap='off'>
1090 if (! $proxysettings { 'SRC_SUBNETS' })
1092 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1093 if ( $netsettings { 'BLUE_DEV' })
1095 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1097 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1104 $line = $Lang :: tr
{ 'advproxy no internal proxy on green' };
1105 $line =~ s/Green/<font color="$Header::colourgreen">Green<\/ font
>/ i
;
1106 print "<td class='base'> $line :</td> \n " ;
1108 <td><input type='checkbox' name='NO_PROXY_LOCAL' $checked {'NO_PROXY_LOCAL'}{'on'} /></td>
1112 if ( $netsettings { 'BLUE_DEV' }) {
1113 $line = $Lang :: tr
{ 'advproxy no internal proxy on blue' };
1114 $line =~ s/Blue/<font color="$Header::colourblue">Blue<\/ font
>/ i
;
1116 print "<td class='base'> $line :</td> \n " ;
1118 <td><input type='checkbox' name='NO_PROXY_LOCAL_BLUE' $checked {'NO_PROXY_LOCAL_BLUE'}{'on'} /></td>
1125 <td colspan='2'> </td>
1128 <td colspan='2'> </td>
1131 <table width='100%'>
1133 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1136 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1137 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1140 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='6' wrap='off'>
1144 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1148 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='6' wrap='off'>
1152 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1158 <table width='100%'>
1160 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1163 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1164 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1167 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='6' wrap='off'>
1171 print $proxysettings { 'SRC_BANNED_IP' };
1175 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='6' wrap='off'>
1179 print $proxysettings { 'SRC_BANNED_MAC' };
1190 # -------------------------------------------------------------------
1191 # CRE GUI - optional
1192 # -------------------------------------------------------------------
1194 if (- e
$cre_enabled ) { print <<END
1195 <table width='100%'>
1198 <td colspan='4'><b> $Lang ::tr{'advproxy classroom extensions'}</b></td>
1201 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1204 <td class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1205 <td><input type='checkbox' name='CLASSROOM_EXT' $checked {'CLASSROOM_EXT'}{'on'} /></td>
1206 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1207 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1210 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1211 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1214 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1218 print $proxysettings { 'CRE_GROUPS' };
1222 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1225 print $proxysettings { 'CRE_SVHOSTS' };
1238 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1239 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1240 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1245 # -------------------------------------------------------------------
1249 <table width='100%'>
1251 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1253 <table width='100%'>
1255 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1256 <td width='1%'> </td>
1257 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1258 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1259 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1260 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1261 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1262 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1263 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1264 <td width='1%'> </td>
1265 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1266 <td width='1%'> </td>
1267 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1272 <select name='TIME_ACCESS_MODE'>
1273 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1274 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1278 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1279 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1280 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1281 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1282 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1283 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1284 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1287 <select name='TIME_FROM_HOUR'>
1290 for ( $i = 0 ; $i <= 24 ; $i ++) {
1291 $_ = sprintf ( " %02s " , $i );
1292 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1299 <select name='TIME_FROM_MINUTE'>
1302 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1303 $_ = sprintf ( " %02s " , $i );
1304 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1311 <select name='TIME_TO_HOUR'>
1314 for ( $i = 0 ; $i <= 24 ; $i ++) {
1315 $_ = sprintf ( " %02s " , $i );
1316 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1323 <select name='TIME_TO_MINUTE'>
1326 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1327 $_ = sprintf ( " %02s " , $i );
1328 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1336 <table width='100%'>
1338 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1341 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1342 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1343 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1344 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1348 <table width='100%'>
1350 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1353 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1354 <td width='20%' class='base'>
1355 <select name='THROTTLING_GREEN_TOTAL'>
1359 foreach ( @throttle_limits ) {
1360 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1364 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1367 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1368 <td width='30%' class='base'>
1369 <select name='THROTTLING_GREEN_HOST'>
1373 foreach ( @throttle_limits ) {
1374 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1378 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1385 if ( $netsettings { 'BLUE_DEV' }) {
1388 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1390 <select name='THROTTLING_BLUE_TOTAL'>
1394 foreach ( @throttle_limits ) {
1395 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1399 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1402 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1404 <select name='THROTTLING_BLUE_HOST'>
1408 foreach ( @throttle_limits ) {
1409 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1413 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1423 <table width='100%'>
1425 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1428 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1429 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1430 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1431 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1432 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1433 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1434 <td width='15%'> </td>
1435 <td width='10%'> </td>
1439 <table width='100%'>
1441 <td colspan='4'><b> $Lang ::tr{'advproxy MIME filter'}</b></td>
1444 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1445 <td width='20%'><input type='checkbox' name='ENABLE_MIME_FILTER' $checked {'ENABLE_MIME_FILTER'}{'on'} /></td>
1448 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1453 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1457 print $proxysettings { 'MIME_TYPES' };
1466 <table width='100%'>
1468 <td colspan='4'><b> $Lang ::tr{'advproxy web browser'}</b></td>
1471 <td width='25%' class='base'> $Lang ::tr{'advproxy UA enable filter'}:</td>
1472 <td width='20%'><input type='checkbox' name='ENABLE_BROWSER_CHECK' $checked {'ENABLE_BROWSER_CHECK'}{'on'} /></td>
1480 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1485 <table width='100%'>
1489 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1490 for ( $i = 0 ; $i <= 3 ; $i ++) {
1491 if ( $i eq 0 ) { print "<tr> \n " ; }
1492 if (( $n + $i ) < @useragentlist ) {
1493 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1494 print "<td width='15%'> @useragent [1]:<\/td> \n " ;
1495 print "<td width='10%'><input type='checkbox' name='UA_ @useragent [0]' $checked {'UA_'. @useragent [0]}{'on'} /></td> \n " ;
1497 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1504 <table width='100%'>
1506 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1509 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1512 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='56' /></td>
1515 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1518 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='56' /></td>
1526 <table width='100%'>
1528 <td class='base' colspan='4'><b> $Lang ::tr{'advproxy url filter'}</b></td>
1531 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1532 <td class='base' width='20%'><input type='checkbox' name='ENABLE_FILTER' $checked {'ENABLE_FILTER'}{'on'} /></td>
1539 <table width='100%'>
1541 <td class='base' colspan='4'><b> $Lang ::tr{'advproxy update accelerator'}</b></td>
1544 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1545 <td class='base' width='20%'><input type='checkbox' name='ENABLE_UPDXLRATOR' $checked {'ENABLE_UPDXLRATOR'}{'on'} /></td>
1552 <table width='100%'>
1554 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1557 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1558 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1559 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1560 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1561 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1562 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1568 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1570 <table width='100%'>
1572 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1575 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1578 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1579 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1580 <td colspan='2' rowspan= '6' valign='top' class='base'>
1581 <table cellpadding='0' cellspacing='0'>
1583 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1586 <!-- intentionally left empty -->
1589 <!-- intentionally left empty -->
1592 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1595 <!-- intentionally left empty -->
1598 <!-- intentionally left empty -->
1601 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1604 <!-- intentionally left empty -->
1607 <!-- intentionally left empty -->
1610 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1614 print $proxysettings { 'DST_NOAUTH' };
1623 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1624 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1627 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1628 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1631 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1632 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1635 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1636 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1639 <td colspan='2'> </td>
1646 # ===================================================================
1647 # NCSA auth settings
1648 # ===================================================================
1650 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1653 <table width='100%'>
1655 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1658 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1659 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1660 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1661 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1664 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1672 # ===================================================================
1673 # IDENTD auth settings
1674 # ===================================================================
1676 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1679 <table width='100%'>
1681 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1684 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1685 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1686 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1687 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1690 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1691 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1696 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1697 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1700 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1703 if (! $proxysettings { 'IDENT_HOSTS' }) {
1704 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1705 if ( $netsettings { 'BLUE_DEV' }) {
1706 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1709 print $proxysettings { 'IDENT_HOSTS' };
1714 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1718 print $proxysettings { 'DST_NOAUTH' };
1725 <table width='100%'>
1727 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1730 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1731 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1732 <td width='25%'> </td>
1733 <td width='30%'> </td>
1736 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1737 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1738 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1739 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1742 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1743 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1746 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1750 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1752 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1754 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1758 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1760 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1767 # ===================================================================
1768 # NTLM auth settings
1769 # ===================================================================
1771 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1774 <table width='100%'>
1776 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1779 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1780 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1781 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1782 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1783 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1784 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1788 <table width='100%'>
1790 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1793 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1794 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1799 <table width='100%'>
1801 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1804 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1805 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1806 <td width='25%'> </td>
1807 <td width='30%'> </td>
1810 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1811 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1812 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1813 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1816 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1817 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1820 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1824 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1826 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1828 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1832 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1834 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1841 # ===================================================================
1842 # LDAP auth settings
1843 # ===================================================================
1845 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1848 <table width='100%'>
1850 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1853 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1854 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1855 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1856 <td class='base'><select name='LDAP_TYPE'>
1857 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1858 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1859 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1860 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1864 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1865 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1866 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1867 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1871 <table width='100%'>
1873 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1876 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1877 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1878 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1879 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1883 <table width='100%'>
1885 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1888 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
1889 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1897 # ===================================================================
1898 # RADIUS auth settings
1899 # ===================================================================
1901 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1904 <table width='100%'>
1906 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1909 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1910 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1911 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1912 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1915 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
1916 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1917 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1918 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1922 <table width='100%'>
1924 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1927 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1928 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1929 <td width='25%'> </td>
1930 <td width='30%'> </td>
1933 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1934 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1935 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1936 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1939 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1940 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1943 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1947 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
1949 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1951 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
1955 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
1957 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1964 # ===================================================================
1970 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
1972 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1973 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1974 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1975 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1976 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
1977 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1978 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
1982 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1984 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1985 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1986 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1987 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1988 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1992 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
1994 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
1995 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
1999 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
2001 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
2002 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
2003 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
2004 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
2005 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
2006 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
2007 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
2011 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2013 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2014 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2015 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2016 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2017 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2018 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2019 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2023 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
2025 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
2026 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
2027 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
2028 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
2029 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
2030 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
2031 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
2032 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
2036 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2038 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2039 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2040 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2041 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2042 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2043 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2044 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2045 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2057 <table width='100%'>
2060 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2061 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2062 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2068 <table width='100%'>
2070 <td><img src='/blob.gif' align='top' alt='*' />
2071 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2073 <td align='right'> </td>
2080 & Header
:: closebox
();
2084 # ===================================================================
2085 # NCSA user management
2086 # ===================================================================
2088 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2090 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2091 <table width='100%'>
2093 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2096 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2097 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2100 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly " ; }
2103 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2105 <select name='NCSA_GROUP'>
2106 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2107 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2108 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2114 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2115 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2116 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2117 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2124 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2125 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2126 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2129 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2130 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2136 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2141 <table width='100%'>
2143 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2146 <table width='100%' align='center'>
2152 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2153 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2157 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2158 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2162 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2163 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2166 @userlist = sort ( @userlist );
2168 # If the password file contains entries, print entries and action icons
2170 if (! - z
" $userdb " ) {
2173 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2174 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2175 <td class='boldbase' colspan='2' align='center'> </td>
2180 foreach $line ( @userlist )
2184 @temp = split ( /:/ , $line );
2185 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2186 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2188 print "<tr bgcolor=' $Header ::table1colour'> \n " ; }
2190 print "<tr bgcolor=' $Header ::table2colour'> \n " ; }
2193 <td align='center'> $temp [0]</td>
2197 if ( $temp [ 1 ] eq 'standard' ) {
2198 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2199 } elsif ( $temp [ 1 ] eq 'extended' ) {
2200 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2201 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2202 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2205 <td width='8%' align='center'>
2206 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2207 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2208 <input type='hidden' name='ID' value=' $line ' />
2209 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2213 <td width='8%' align='center'>
2214 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2215 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2216 <input type='hidden' name='ID' value=' $temp [0]' />
2217 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2230 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2231 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2232 <td class='base'> $Lang ::tr{'edit'}</td>
2233 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2234 <td class='base'> $Lang ::tr{'remove'}</td>
2241 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2252 & Header
:: closebox
();
2256 # ===================================================================
2258 & Header
:: closebigbox
();
2260 & Header
:: closepage
();
2262 # -------------------------------------------------------------------
2266 if (- e
" $acl_src_subnets " ) {
2267 open ( FILE
, " $acl_src_subnets " );
2268 delete $proxysettings { 'SRC_SUBNETS' };
2269 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2272 if (- e
" $acl_src_banned_ip " ) {
2273 open ( FILE
, " $acl_src_banned_ip " );
2274 delete $proxysettings { 'SRC_BANNED_IP' };
2275 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2278 if (- e
" $acl_src_banned_mac " ) {
2279 open ( FILE
, " $acl_src_banned_mac " );
2280 delete $proxysettings { 'SRC_BANNED_MAC' };
2281 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2284 if (- e
" $acl_src_unrestricted_ip " ) {
2285 open ( FILE
, " $acl_src_unrestricted_ip " );
2286 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2287 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2290 if (- e
" $acl_src_unrestricted_mac " ) {
2291 open ( FILE
, " $acl_src_unrestricted_mac " );
2292 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2293 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2296 if (- e
" $acl_dst_nocache " ) {
2297 open ( FILE
, " $acl_dst_nocache " );
2298 delete $proxysettings { 'DST_NOCACHE' };
2299 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2302 if (- e
" $acl_dst_noauth " ) {
2303 open ( FILE
, " $acl_dst_noauth " );
2304 delete $proxysettings { 'DST_NOAUTH' };
2305 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2308 if (- e
" $acl_ports_safe " ) {
2309 open ( FILE
, " $acl_ports_safe " );
2310 delete $proxysettings { 'PORTS_SAFE' };
2311 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2314 if (- e
" $acl_ports_ssl " ) {
2315 open ( FILE
, " $acl_ports_ssl " );
2316 delete $proxysettings { 'PORTS_SSL' };
2317 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2320 if (- e
" $mimetypes " ) {
2321 open ( FILE
, " $mimetypes " );
2322 delete $proxysettings { 'MIME_TYPES' };
2323 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2326 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2327 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2328 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2329 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2332 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2333 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2334 delete $proxysettings { 'NTLM_DENY_USERS' };
2335 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2338 if (- e
" $raddir /radauth.allowusers" ) {
2339 open ( FILE
, " $raddir /radauth.allowusers" );
2340 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2341 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2344 if (- e
" $raddir /radauth.denyusers" ) {
2345 open ( FILE
, " $raddir /radauth.denyusers" );
2346 delete $proxysettings { 'RADIUS_DENY_USERS' };
2347 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2350 if (- e
" $identdir /identauth.allowusers" ) {
2351 open ( FILE
, " $identdir /identauth.allowusers" );
2352 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2353 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2356 if (- e
" $identdir /identauth.denyusers" ) {
2357 open ( FILE
, " $identdir /identauth.denyusers" );
2358 delete $proxysettings { 'IDENT_DENY_USERS' };
2359 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2362 if (- e
" $identhosts " ) {
2363 open ( FILE
, " $identhosts " );
2364 delete $proxysettings { 'IDENT_HOSTS' };
2365 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2368 if (- e
" $cre_groups " ) {
2369 open ( FILE
, " $cre_groups " );
2370 delete $proxysettings { 'CRE_GROUPS' };
2371 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2374 if (- e
" $cre_svhosts " ) {
2375 open ( FILE
, " $cre_svhosts " );
2376 delete $proxysettings { 'CRE_SVHOSTS' };
2377 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2382 # -------------------------------------------------------------------
2386 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2387 undef $proxysettings { 'PORTS_SAFE' };
2390 s/^\s+//g ; s/\s+$//g ;
2394 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2396 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2397 @templist = split ( /-/ );
2398 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2399 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2403 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2404 undef $proxysettings { 'PORTS_SSL' };
2407 s/^\s+//g ; s/\s+$//g ;
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_SSL' } .= $line . " \n " ;
2419 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2420 undef $proxysettings { 'DST_NOCACHE' };
2423 s/^\s+//g ; s/\s+$//g ;
2426 unless ( /^\./ ) { $_ = '.' . $_ ; }
2427 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2431 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2432 undef $proxysettings { 'SRC_SUBNETS' };
2435 s/^\s+//g ; s/\s+$//g ;
2438 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2439 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2443 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2444 undef $proxysettings { 'SRC_BANNED_IP' };
2447 s/^\s+//g ; s/\s+$//g ;
2450 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2451 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2455 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2456 undef $proxysettings { 'SRC_BANNED_MAC' };
2459 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2462 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2463 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2467 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2468 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2471 s/^\s+//g ; s/\s+$//g ;
2474 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2475 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2479 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2480 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2483 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2486 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2487 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2491 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2492 undef $proxysettings { 'DST_NOAUTH' };
2495 s/^\s+//g ; s/\s+$//g ;
2498 unless ( /^\./ ) { $_ = '.' . $_ ; }
2499 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2503 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2505 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2506 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2509 s/^\s+//g ; s/\s+$//g ;
2510 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2512 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2515 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2517 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2518 undef $proxysettings { 'NTLM_DENY_USERS' };
2521 s/^\s+//g ; s/\s+$//g ;
2522 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2524 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2527 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2529 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2530 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2533 s/^\s+//g ; s/\s+$//g ;
2534 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2536 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2539 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2541 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2542 undef $proxysettings { 'IDENT_DENY_USERS' };
2545 s/^\s+//g ; s/\s+$//g ;
2546 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2548 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2551 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2553 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2554 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2557 s/^\s+//g ; s/\s+$//g ;
2558 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2560 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2563 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2565 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2566 undef $proxysettings { 'RADIUS_DENY_USERS' };
2569 s/^\s+//g ; s/\s+$//g ;
2570 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2572 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2575 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2576 undef $proxysettings { 'IDENT_HOSTS' };
2579 s/^\s+//g ; s/\s+$//g ;
2582 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2583 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2587 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2588 undef $proxysettings { 'CRE_SVHOSTS' };
2591 s/^\s+//g ; s/\s+$//g ;
2594 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2595 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2600 # -------------------------------------------------------------------
2604 open ( FILE
, "> $acl_src_subnets " );
2606 if (! $proxysettings { 'SRC_SUBNETS' })
2608 print FILE
" $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
2609 if ( $netsettings { 'BLUE_DEV' })
2611 print FILE
" $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
2613 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2616 open ( FILE
, "> $acl_src_banned_ip " );
2618 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2621 open ( FILE
, "> $acl_src_banned_mac " );
2623 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2626 open ( FILE
, "> $acl_src_unrestricted_ip " );
2628 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2631 open ( FILE
, "> $acl_src_unrestricted_mac " );
2633 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2636 open ( FILE
, "> $acl_dst_nocache " );
2638 print FILE
$proxysettings { 'DST_NOCACHE' };
2641 open ( FILE
, "> $acl_dst_noauth " );
2643 print FILE
$proxysettings { 'DST_NOAUTH' };
2646 open ( FILE
, "> $acl_ports_safe " );
2648 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2651 open ( FILE
, "> $acl_ports_ssl " );
2653 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2656 open ( FILE
, "> $acl_dst_throttle " );
2658 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2660 @temp = split ( /\|/ , $throttle_binary );
2661 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2663 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2665 @temp = split ( /\|/ , $throttle_dskimg );
2666 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2668 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2670 @temp = split ( /\|/ , $throttle_mmedia );
2671 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2673 if (- s
$throttled_urls )
2675 open ( URLFILE
, $throttled_urls );
2678 foreach ( @temp ) { print FILE
; }
2682 open ( FILE
, "> $mimetypes " );
2684 print FILE
$proxysettings { 'MIME_TYPES' };
2687 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2689 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2692 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2694 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2697 open ( FILE
, "> $raddir /radauth.allowusers" );
2699 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2702 open ( FILE
, "> $raddir /radauth.denyusers" );
2704 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2707 open ( FILE
, "> $identdir /identauth.allowusers" );
2709 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2712 open ( FILE
, "> $identdir /identauth.denyusers" );
2714 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2717 open ( FILE
, "> $identhosts " );
2719 print FILE
$proxysettings { 'IDENT_HOSTS' };
2722 open ( FILE
, "> $cre_groups " );
2724 print FILE
$proxysettings { 'CRE_GROUPS' };
2727 open ( FILE
, "> $cre_svhosts " );
2729 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2733 # -------------------------------------------------------------------
2737 open ( FILE
, ">/home/httpd/html/proxy.pac" );
2739 print FILE
"function FindProxyForURL(url, host) \n " ;
2741 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2745 (isPlainHostName(host)) ||
2746 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2747 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2748 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2749 (isInNet(host, "169.254.0.0", "255.255.0.0")) ||
2750 (isInNet(host, "192.168.0.0", "255.255.0.0"))
2758 if ( $proxysettings { 'ENABLE' } eq 'on' )
2762 (isInNet(myIpAddress(), " $netsettings {'GREEN_NETADDRESS'}", " $netsettings {'GREEN_NETMASK'}"))
2764 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2768 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2770 print FILE
" \n else \n\n " ;
2772 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2776 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2778 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2787 # -------------------------------------------------------------------
2794 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2795 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2796 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2797 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2799 $delaypools = 1 ; } else { $delaypools = 0 ;
2802 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2804 $authrealm = "IPCop Advanced Proxy Server" ;
2806 $authrealm = $proxysettings { 'AUTH_REALM' };
2809 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2810 my ( $remotehost , $remoteport ) = ( /^(?:[a-zA-Z ]+\:\/ \
/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/ .* ?
) ?
$/);
2812 if ( $remoteport eq '' ) { $remoteport = 80 ; }
2814 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
2817 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
2818 # you make will be overwritten whenever you resave proxy settings using the
2821 # Instead, modify the file ' $acl_include ' and
2822 # then restart the proxy service using the web interface. Changes made to the
2823 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
2825 shutdown_lifetime 5 seconds
2830 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2831 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) { print FILE
" transparent" }
2832 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2835 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
2836 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2837 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) { print FILE
" transparent" }
2838 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2844 acl QUERY urlpath_regex cgi-bin \\ ?
2848 if (!- z
$acl_dst_nocache ) {
2849 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache \"\n " ;
2850 print FILE
"cache deny no_cache_domains \n " ;
2855 cache_effective_user squid
2856 cache_effective_group squid
2859 pid_filename /var/run/squid.pid
2861 cache_mem $proxysettings {'CACHE_MEM'} MB
2862 cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256
2867 if (( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ))
2869 print FILE
"error_directory $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2871 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2874 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
2876 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
2878 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
2880 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
2882 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
2884 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
2889 if ( $proxysettings { 'LOGGING' } eq 'on' )
2892 access_log /var/log/squid/access.log
2893 cache_log /var/log/squid/cache.log
2894 cache_store_log none
2897 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"useragent_log \/var\/log\/squid\/user_agent.log \n " ; }
2898 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
2901 access_log /dev/null
2903 cache_store_log none
2912 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
2914 print FILE
"forwarded_for on \n " ;
2916 print FILE
"forwarded_for off \n " ;
2918 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
2920 print FILE
"via on \n " ;
2922 print FILE
"via off \n " ;
2926 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
2928 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
2930 print FILE
"auth_param basic program $authdir /ncsa_auth $userdb \n " ;
2931 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2932 print FILE
"auth_param basic realm $authrealm \n " ;
2933 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2934 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2937 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
2939 print FILE
"auth_param basic program $authdir /squid_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
2940 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
2941 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
2942 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
2944 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2946 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
2948 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2950 print FILE
" -u sAMAccountName -P" ;
2952 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
2954 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2956 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
2958 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
2960 print FILE
" -u cn -P" ;
2962 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
2964 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2966 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
2968 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2970 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
2971 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
2972 print FILE
" -u uid -P" ;
2974 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
2975 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2976 print FILE
"auth_param basic realm $authrealm \n " ;
2977 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2978 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2981 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
2983 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
2985 print FILE
"auth_param ntlm program $authdir /ntlm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
2986 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
2987 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
2988 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2990 print FILE
"auth_param basic program $authdir /msnt_auth \n " ;
2991 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2992 print FILE
"auth_param basic realm $authrealm \n " ;
2993 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2994 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2996 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
2998 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
2999 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
3000 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
3001 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3003 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
3005 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
3007 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
3014 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3016 print FILE
"auth_param basic program $authdir /squid_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3017 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3018 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3019 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3020 print FILE
"auth_param basic realm $authrealm \n " ;
3021 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3022 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3026 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3027 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
3029 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
3031 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
3033 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
3035 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
3038 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3040 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3042 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3044 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3046 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3049 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3052 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3053 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3055 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3058 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3062 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3064 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3066 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3068 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3070 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3072 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3074 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3076 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3079 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3083 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3085 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
3087 print FILE
"acl within_timeframe time " ;
3088 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3089 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3090 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3091 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3092 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3093 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3094 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3095 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3096 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3097 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3098 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3100 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3101 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3105 acl all src 0.0.0.0/0.0.0.0
3106 acl localhost src 127.0.0.1/255.255.255.255
3109 open ( PORTS
, " $acl_ports_ssl " );
3114 foreach ( @temp ) { print FILE
"acl SSL_ports port $_ " ; }
3116 open ( PORTS
, " $acl_ports_safe " );
3121 foreach ( @temp ) { print FILE
"acl Safe_ports port $_ " ; }
3125 acl IPCop_http port $http_port
3126 acl IPCop_https port $https_port
3127 acl IPCop_ips dst $netsettings {'GREEN_ADDRESS'}
3128 acl IPCop_networks src " $acl_src_subnets "
3129 acl IPCop_servers dst " $acl_src_subnets "
3130 acl IPCop_green_network src $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3131 acl IPCop_green_servers dst $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3134 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_network src $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3135 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_servers dst $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3136 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPCop_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3137 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPCop_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3138 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPCop_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3139 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPCop_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3141 acl CONNECT method CONNECT
3145 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3148 #Classroom extensions
3149 acl IPCop_no_access_ips src " $acl_src_noaccess_ip "
3150 acl IPCop_no_access_mac arp " $acl_src_noaccess_mac "
3153 print FILE
"deny_info " ;
3154 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3155 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3157 print FILE
"ERR_ACCESS_DISABLED" ;
3159 print FILE
"ERR_ACCESS_DENIED" ;
3161 print FILE
" IPCop_no_access_ips \n " ;
3162 print FILE
"deny_info " ;
3163 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3164 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3166 print FILE
"ERR_ACCESS_DISABLED" ;
3168 print FILE
"ERR_ACCESS_DENIED" ;
3170 print FILE
" IPCop_no_access_mac \n " ;
3173 http_access deny IPCop_no_access_ips
3174 http_access deny IPCop_no_access_mac
3179 #Insert acl file and replace __VAR__ with correct values
3180 my $blue_net = '' ; #BLUE empty by default
3182 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3183 $blue_net = " $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'}" ;
3184 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3186 if (!- z
$acl_include )
3188 open ( ACL
, " $acl_include " );
3189 print FILE
" \n #Start of custom includes \n " ;
3191 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3192 $_ =~ s/__GREEN_NET__/$netsettings{'GREEN_NETADDRESS'}\/ $netsettings { 'GREEN_NETMASK' }/;
3193 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3194 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3195 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3198 print FILE
"#End of custom includes \n " ;
3201 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3205 #local machine, no restriction
3206 http_access allow localhost
3208 #GUI admin if local machine connects
3209 http_access allow IPCop_ips IPCop_networks IPCop_http
3210 http_access allow CONNECT IPCop_ips IPCop_networks IPCop_https
3212 #Deny not web services
3213 http_access deny !Safe_ports
3214 http_access deny CONNECT !SSL_ports
3219 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3221 print FILE
"#Set ident ACLs \n " ;
3222 if (!- z
$identhosts )
3224 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3225 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3226 print FILE
"ident_lookup_access deny all \n " ;
3228 print FILE
"ident_lookup_access allow all \n " ;
3230 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3234 print FILE
"#Set download throttling \n " ;
3236 if ( $netsettings { 'BLUE_DEV' })
3238 print FILE
"delay_pools 2 \n " ;
3240 print FILE
"delay_pools 1 \n " ;
3243 print FILE
"delay_class 1 3 \n " ;
3244 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3246 print FILE
"delay_parameters 1 " ;
3247 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3251 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3253 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3256 print FILE
" -1/-1 " ;
3257 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3261 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3263 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3267 if ( $netsettings { 'BLUE_DEV' })
3269 print FILE
"delay_parameters 2 " ;
3270 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3274 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3276 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3278 print FILE
" -1/-1 " ;
3279 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3283 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3285 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3290 print FILE
"delay_access 1 deny IPCop_ips \n " ;
3291 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPCop_unrestricted_ips \n " ; }
3292 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPCop_unrestricted_mac \n " ; }
3293 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3295 if ( $netsettings { 'BLUE_DEV' })
3297 print FILE
"delay_access 1 allow IPCop_green_network" ;
3298 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3300 print FILE
"delay_access 1 deny all \n " ;
3302 print FILE
"delay_access 1 allow all" ;
3303 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3307 if ( $netsettings { 'BLUE_DEV' })
3309 print FILE
"delay_access 2 deny IPCop_ips \n " ;
3310 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPCop_unrestricted_ips \n " ; }
3311 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPCop_unrestricted_mac \n " ; }
3312 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3313 print FILE
"delay_access 2 allow IPCop_blue_network" ;
3314 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3316 print FILE
"delay_access 2 deny all \n " ;
3319 print FILE
"delay_initial_bucket_level 100 \n " ;
3323 if ( $proxysettings { 'NO_PROXY_LOCAL' } eq 'on' )
3325 print FILE
"#Prevent internal proxy access to Green \n " ;
3326 print FILE
"http_access deny IPCop_green_servers !IPCop_green_network \n\n " ;
3329 if ( $proxysettings { 'NO_PROXY_LOCAL_BLUE' } eq 'on' )
3331 print FILE
"#Prevent internal proxy access from Blue \n " ;
3332 print FILE
"http_access allow IPCop_blue_network IPCop_blue_servers \n " ;
3333 print FILE
"http_access deny IPCop_blue_network IPCop_servers \n\n " ;
3337 #Set custom configured ACLs
3340 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPCop_banned_ips \n " ; }
3341 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPCop_banned_mac \n " ; }
3343 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3345 if (!- z
$acl_src_unrestricted_ip )
3347 print FILE
"http_access allow IPCop_unrestricted_ips to_domains_without_auth \n " ;
3349 if (!- z
$acl_src_unrestricted_mac )
3351 print FILE
"http_access allow IPCop_unrestricted_mac to_domains_without_auth \n " ;
3353 print FILE
"http_access allow IPCop_networks" ;
3354 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3355 print FILE
" !within_timeframe" ;
3357 print FILE
" within_timeframe" ; }
3358 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3359 print FILE
" to_domains_without_auth \n " ;
3362 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3364 print FILE
"http_access deny !for_inetusers" ;
3365 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3370 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3371 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3372 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3373 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3374 (!- z
" $identdir /identauth.denyusers" )
3377 print FILE
"http_access deny for_acl_users" ;
3378 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3382 if (!- z
$acl_src_unrestricted_ip )
3384 print FILE
"http_access allow IPCop_unrestricted_ips" ;
3385 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3387 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3389 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3391 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3393 print FILE
" for_inetusers" ;
3395 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3397 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3399 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3401 print FILE
" for_acl_users" ;
3403 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3405 print FILE
" !for_acl_users" ;
3407 } else { print FILE
" for_inetusers" ; }
3409 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3411 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3413 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3415 print FILE
" for_acl_users" ;
3417 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3419 print FILE
" !for_acl_users" ;
3421 } else { print FILE
" for_inetusers" ; }
3427 if (!- z
$acl_src_unrestricted_mac )
3429 print FILE
"http_access allow IPCop_unrestricted_mac" ;
3430 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3432 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3434 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3436 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3438 print FILE
" for_inetusers" ;
3440 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3442 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3444 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3446 print FILE
" for_acl_users" ;
3448 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3450 print FILE
" !for_acl_users" ;
3452 } else { print FILE
" for_inetusers" ; }
3454 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3456 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3458 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3460 print FILE
" for_acl_users" ;
3462 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3464 print FILE
" !for_acl_users" ;
3466 } else { print FILE
" for_inetusers" ; }
3472 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3474 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3475 if (!- z
$extgrp ) { print FILE
"http_access allow IPCop_networks for_extended_users \n " ; }
3480 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3481 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3482 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3483 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3484 (!- z
" $ntlmdir /msntauth.denyusers" )
3488 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3489 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3490 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3491 (!- z
" $raddir /radauth.denyusers" )
3495 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3496 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3497 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3498 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3499 (!- z
" $identdir /identauth.denyusers" )
3503 print FILE
"http_access deny for_acl_users" ;
3504 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3508 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3510 print FILE
"http_access allow" ;
3511 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3512 print FILE
" !within_timeframe" ;
3514 print FILE
" within_timeframe" ; }
3515 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3516 print FILE
" !on_ident_aware_hosts \n " ;
3519 print FILE
"http_access allow IPCop_networks" ;
3522 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3523 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3524 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3525 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3526 (!- z
" $ntlmdir /msntauth.allowusers" )
3530 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3531 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3532 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3533 (!- z
" $raddir /radauth.allowusers" )
3537 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3538 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3539 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3540 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3541 (!- z
" $identdir /identauth.allowusers" )
3545 print FILE
" for_acl_users" ;
3546 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3547 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3548 print FILE
" for_inetusers" ;
3550 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3552 print FILE
" !concurrent" ;
3554 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3555 print FILE
" !within_timeframe" ;
3557 print FILE
" within_timeframe" ; }
3558 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3561 print FILE
"http_access deny all \n\n " ;
3563 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3564 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3566 print FILE
"#Strip HTTP Header \n " ;
3568 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3570 print FILE
"header_access X-Forwarded-For deny all \n " ;
3572 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3574 print FILE
"header_access Via deny all \n " ;
3576 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3578 print FILE
"header_access User-Agent deny all \n " ;
3580 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3582 print FILE
"header_access Referer deny all \n " ;
3587 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3589 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3591 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3593 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3595 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3601 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3603 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3604 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPCop_unrestricted_ips \n " ; }
3605 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPCop_unrestricted_mac \n " ; }
3606 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3608 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3610 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3611 print FILE
"http_reply_access allow all \n\n " ;
3615 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3616 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3618 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3621 $replybodymaxsize = 1024 * $proxysettings { 'MAX_INCOMING_SIZE' };
3622 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3623 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_ips \n " ; }
3624 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_mac \n " ; }
3625 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3627 if (!- z
$extgrp ) { print FILE
"reply_body_max_size 0 allow for_extended_users \n " ; }
3630 print FILE
"reply_body_max_size $replybodymaxsize allow all \n\n " ;
3632 print FILE
"visible_hostname" ;
3633 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3635 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3637 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3640 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n\n " ; }
3642 # Write the parent proxy info, if needed.
3643 if ( $remotehost ne '' )
3645 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3647 # Enter authentication for the parent cache. Option format is
3648 # login=user:password ($proxy1='YES')
3649 # login=PASS ($proxy1='PASS')
3650 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3651 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3653 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3654 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3656 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3658 print FILE
" \n never_direct allow all \n\n " ;
3660 if (( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) && ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ))
3662 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3663 if ( $filtersettings { 'CHILDREN' } > $xlratorsettings { 'CHILDREN' })
3665 print FILE
"url_rewrite_children $filtersettings {'CHILDREN'} \n\n " ;
3667 print FILE
"url_rewrite_children $xlratorsettings {'CHILDREN'} \n\n " ;
3672 if ( $proxysettings { 'ENABLE_FILTER' } eq 'on' )
3675 url_rewrite_program /usr/bin/squidGuard
3676 url_rewrite_children $filtersettings {'CHILDREN'}
3681 if ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' )
3684 url_rewrite_program /usr/sbin/updxlrator
3685 url_rewrite_children $xlratorsettings {'CHILDREN'}
3694 # -------------------------------------------------------------------
3698 my ( $str_user , $str_pass , $str_group ) = @_ ;
3699 my @groupmembers =();
3701 if ( $str_pass eq 'lEaVeAlOnE' )
3703 open ( FILE
, " $userdb " );
3704 @groupmembers = < FILE
>;
3706 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3707 & deluser
( $str_user );
3708 open ( FILE
, ">> $userdb " );
3710 print FILE
" $str_user $str_pass " ;
3713 & deluser
( $str_user );
3714 system ( "/usr/bin/htpasswd -b $userdb $str_user $str_pass " );
3717 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3718 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3719 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3721 print FILE
" $str_user \n " ;
3727 # -------------------------------------------------------------------
3731 my ( $str_user ) = @_ ;
3733 my @groupmembers =();
3736 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3739 open ( FILE
, " $groupfile " );
3740 @groupmembers = < FILE
>;
3742 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3743 open ( FILE
, "> $groupfile " );
3745 print FILE
@templist ;
3750 open ( FILE
, " $userdb " );
3751 @groupmembers = < FILE
>;
3753 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3754 open ( FILE
, "> $userdb " );
3756 print FILE
@templist ;
3762 # -------------------------------------------------------------------