]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/proxy.cgi
5 # This code is distributed under the terms of the GPL
7 # $Id: advproxy.cgi,v 2.0.0 [beta] 2006/09/03 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 %updaccelsettings =();
28 my %stdproxysettings =();
30 my $urlfilter_addon = 0 ;
36 my @throttle_limits =( 64 , 128 , 256 , 384 , 512 , 1024 , 2048 , 3072 , 5120 );
37 my $throttle_binary = "bin|cab|exe|gz|rar|sea|tar|tgz|zip" ;
38 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi" ;
39 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|qt|ra?m" ;
41 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 " ;
42 my $def_ports_ssl = "443 # https \n 563 # snews \n " ;
47 my $hintcolour = '#FFFFCC' ;
48 my $ncsa_buttontext = '' ;
63 my $replybodymaxsize = 0 ;
64 my $browser_regexp = '' ;
68 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
69 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
70 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
71 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
72 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
73 my $credir = "${General::swroot}/proxy/advanced/cre" ;
75 my $userdb = " $ncsadir /passwd" ;
76 my $stdgrp = " $ncsadir /standard.grp" ;
77 my $extgrp = " $ncsadir /extended.grp" ;
78 my $disgrp = " $ncsadir /disabled.grp" ;
80 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
81 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
82 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
84 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
85 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
86 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
88 my $identhosts = " $identdir /hosts" ;
90 my $authdir = "/usr/lib/squid/advproxy/auth" ;
91 my $errordir = "/usr/lib/squid/advproxy/errors" ;
93 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
94 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
95 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
96 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
97 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
98 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
99 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
100 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
101 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
102 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
103 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
104 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
105 my $acl_include = " $acldir /include.acl" ;
107 my $updaccelversion = 'n/a' ;
108 my $urlfilterversion = 'n/a' ;
110 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
111 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
112 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
113 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
114 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
115 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
117 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
118 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
120 unless (- e
$userdb ) { system ( "touch $userdb " ); }
121 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
122 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
123 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
125 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
126 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
127 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
128 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
129 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
130 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
131 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
132 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
133 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
134 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
135 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
136 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
137 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
139 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
140 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
142 open FILE
, $browserdb ;
143 @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
>;
146 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
147 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
149 if (- e
"${General::swroot}/urlfilter/version" ) { $urlfilter_addon = 1 ; }
150 if (- e
"${General::swroot}/updatexlrator/version" ) { $updaccel_addon = 1 ; }
152 if ( $urlfilter_addon ) {
153 $filtersettings { 'CHILDREN' } = '5' ;
154 if (- e
"${General::swroot}/urlfilter/settings" ) {
155 & General
:: readhash
( "${General::swroot}/urlfilter/settings" , \
%filtersettings );
157 $urlfilterversion = `cat ${General::swroot}/urlfilter/version` ;
158 $urlfilterversion =~ s/([^\s]+).*/$1/ ;
161 if ( $updaccel_addon ) {
162 $updaccelsettings { 'CHILDREN' } = '10' ;
163 if (- e
"${General::swroot}/updatexlrator/settings" ) {
164 & General
:: readhash
( "${General::swroot}/updatexlrator/settings" , \
%updaccelsettings );
166 $updaccelversion = `cat ${General::swroot}/updatexlrator/version` ;
167 $updaccelversion =~ s/([^\s]+).*/$1/ ;
170 & Header
:: showhttpheaders
();
172 $proxysettings { 'ACTION' } = '' ;
173 $proxysettings { 'VALID' } = '' ;
175 $proxysettings { 'ENABLE' } = 'off' ;
176 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
177 $proxysettings { 'TRANSPARENT' } = 'off' ;
178 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
179 $proxysettings { 'PROXY_PORT' } = '800' ;
180 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
181 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
182 $proxysettings { 'ERR_LANGUAGE' } = 'English' ;
183 $proxysettings { 'ERR_DESIGN' } = 'IPCop' ;
184 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
185 $proxysettings { 'FORWARD_VIA' } = 'off' ;
186 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
187 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
188 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
189 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
190 $proxysettings { 'UPSTREAM_USER' } = '' ;
191 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
192 $proxysettings { 'LOGGING' } = 'off' ;
193 $proxysettings { 'LOGQUERY' } = 'off' ;
194 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
195 $proxysettings { 'CACHE_MEM' } = '2' ;
196 $proxysettings { 'CACHE_SIZE' } = '50' ;
197 $proxysettings { 'MAX_SIZE' } = '4096' ;
198 $proxysettings { 'MIN_SIZE' } = '0' ;
199 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
200 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
201 $proxysettings { 'L1_DIRS' } = '16' ;
202 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
203 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
204 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
205 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
206 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
207 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
208 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
209 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
210 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
211 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
212 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
213 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
214 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
215 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
216 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
217 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
218 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
219 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
220 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
221 $proxysettings { 'FAKE_USERAGENT' } = '' ;
222 $proxysettings { 'FAKE_REFERER' } = '' ;
223 $proxysettings { 'AUTH_METHOD' } = 'none' ;
224 $proxysettings { 'AUTH_REALM' } = '' ;
225 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
226 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
227 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
228 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
229 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
230 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
231 $proxysettings { 'NCSA_USERNAME' } = '' ;
232 $proxysettings { 'NCSA_GROUP' } = '' ;
233 $proxysettings { 'NCSA_PASS' } = '' ;
234 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
235 $proxysettings { 'LDAP_BASEDN' } = '' ;
236 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
237 $proxysettings { 'LDAP_SERVER' } = '' ;
238 $proxysettings { 'LDAP_PORT' } = '389' ;
239 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
240 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
241 $proxysettings { 'LDAP_GROUP' } = '' ;
242 $proxysettings { 'NTLM_DOMAIN' } = '' ;
243 $proxysettings { 'NTLM_PDC' } = '' ;
244 $proxysettings { 'NTLM_BDC' } = '' ;
245 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
246 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
247 $proxysettings { 'RADIUS_SERVER' } = '' ;
248 $proxysettings { 'RADIUS_PORT' } = '1812' ;
249 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
250 $proxysettings { 'RADIUS_SECRET' } = '' ;
251 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
252 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
253 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
254 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
255 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
256 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
258 if ( $urlfilter_addon ) {
259 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
262 if ( $updaccel_addon ) {
263 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
266 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
268 & Header
:: getcgihash
( \
%proxysettings );
270 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
271 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
272 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
273 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
275 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
277 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
280 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
282 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
283 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
284 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
286 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
287 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
289 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
290 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
292 if (! $errormessage ) {
293 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
294 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
296 $proxysettings { 'NCSA_USERNAME' } = '' ;
297 $proxysettings { 'NCSA_GROUP' } = '' ;
298 $proxysettings { 'NCSA_PASS' } = '' ;
299 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
302 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
304 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
305 & deluser
( $proxysettings { 'ID' });
308 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
310 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
311 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
312 @temp = split ( /:/ , $proxysettings { 'ID' });
313 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
314 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
315 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
316 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
319 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }))
321 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
322 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
323 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
324 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
325 $errormessage = $Lang :: tr
{ 'invalid input' };
328 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
330 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
333 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
334 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
336 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
339 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
340 ( $proxysettings { 'CACHE_MEM' } < 1 ))
342 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
345 my @free = `/usr/bin/free` ;
346 $free [ 1 ] =~ m/(\d+)/ ;
347 $cachemem = int $1 / 2048 ;
348 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
349 $proxysettings { 'CACHE_MEM' } = $cachemem ;
351 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
353 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
356 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
358 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
361 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
363 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
366 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
368 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
371 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
373 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
376 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
378 $browser_regexp = '' ;
379 foreach ( @useragentlist )
382 @useragent = split ( /,/ );
383 if ( $proxysettings { 'UA_' . @useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " @useragent [2]|" ; }
385 chop ( $browser_regexp );
386 if (! $browser_regexp )
388 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
392 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
394 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
395 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
396 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
398 if ( $netsettings { 'BLUE_DEV' })
400 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
401 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
403 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
407 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
409 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
414 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
415 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
417 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
420 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
422 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
425 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
427 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
430 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
432 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
435 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
437 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
441 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
443 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
445 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
449 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
451 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
453 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
457 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
459 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
461 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
464 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
466 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
469 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
471 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
474 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
476 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
478 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
483 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
485 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
487 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
490 if ( $proxysettings { 'NTLM_PDC' } eq '' )
492 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
495 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
497 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
500 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
502 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
506 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
508 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
510 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
513 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
515 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
518 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
520 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
525 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
528 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
529 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
530 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
531 if (( $proxy1 ne $proxy2 ))
533 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
541 $proxysettings { 'VALID' } = 'no' ; }
543 $proxysettings { 'VALID' } = 'yes' ; }
545 if ( $proxysettings { 'VALID' } eq 'yes' )
549 delete $proxysettings { 'SRC_SUBNETS' };
550 delete $proxysettings { 'SRC_BANNED_IP' };
551 delete $proxysettings { 'SRC_BANNED_MAC' };
552 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
553 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
554 delete $proxysettings { 'DST_NOCACHE' };
555 delete $proxysettings { 'DST_NOAUTH' };
556 delete $proxysettings { 'PORTS_SAFE' };
557 delete $proxysettings { 'PORTS_SSL' };
558 delete $proxysettings { 'MIME_TYPES' };
559 delete $proxysettings { 'NTLM_ALLOW_USERS' };
560 delete $proxysettings { 'NTLM_DENY_USERS' };
561 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
562 delete $proxysettings { 'RADIUS_DENY_USERS' };
563 delete $proxysettings { 'IDENT_HOSTS' };
564 delete $proxysettings { 'IDENT_ALLOW_USERS' };
565 delete $proxysettings { 'IDENT_DENY_USERS' };
567 delete $proxysettings { 'CRE_GROUPS' };
568 delete $proxysettings { 'CRE_SVHOSTS' };
570 delete $proxysettings { 'NCSA_USERNAME' };
571 delete $proxysettings { 'NCSA_GROUP' };
572 delete $proxysettings { 'NCSA_PASS' };
573 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
575 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
576 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
577 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
578 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
579 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
580 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
581 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
583 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
584 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
586 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
588 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
589 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
590 if ( $urlfilter_addon ) { $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' }; }
591 if ( $updaccel_addon ) { $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' }; }
592 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
597 unlink "${General::swroot}/proxy/enable" ;
598 unlink "${General::swroot}/proxy/transparent" ;
599 unlink "${General::swroot}/proxy/enable_blue" ;
600 unlink "${General::swroot}/proxy/transparent_blue" ;
602 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
603 system ( '/bin/touch' , "${General::swroot}/proxy/enable" ); }
604 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) {
605 system ( '/bin/touch' , "${General::swroot}/proxy/transparent" ); }
606 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
607 system ( '/bin/touch' , "${General::swroot}/proxy/enable_blue" ); }
608 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) {
609 system ( '/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
611 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/restartsquid' ); }
615 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
617 system ( '/usr/local/bin/restartsquid' , '-f' );
622 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
623 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
624 } elsif (- e
"${General::swroot}/proxy/settings" ) {
625 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
630 $checked { 'ENABLE' }{ 'off' } = '' ;
631 $checked { 'ENABLE' }{ 'on' } = '' ;
632 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
634 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
635 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
636 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
638 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
639 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
640 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
642 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
643 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
644 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
646 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
647 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
648 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
650 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
651 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
652 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
653 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
654 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
655 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
656 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
657 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
658 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
659 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
660 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
661 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
663 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
664 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
665 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
666 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
667 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
668 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
670 $checked { 'LOGGING' }{ 'off' } = '' ;
671 $checked { 'LOGGING' }{ 'on' } = '' ;
672 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
673 $checked { 'LOGQUERY' }{ 'off' } = '' ;
674 $checked { 'LOGQUERY' }{ 'on' } = '' ;
675 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
676 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
677 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
678 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
680 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
681 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
683 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
684 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
685 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
687 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
688 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
689 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
690 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
691 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
693 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
694 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
695 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
696 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
697 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
698 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
699 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
701 $checked { 'TIME_MON' }{ 'off' } = '' ;
702 $checked { 'TIME_MON' }{ 'on' } = '' ;
703 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
704 $checked { 'TIME_TUE' }{ 'off' } = '' ;
705 $checked { 'TIME_TUE' }{ 'on' } = '' ;
706 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
707 $checked { 'TIME_WED' }{ 'off' } = '' ;
708 $checked { 'TIME_WED' }{ 'on' } = '' ;
709 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
710 $checked { 'TIME_THU' }{ 'off' } = '' ;
711 $checked { 'TIME_THU' }{ 'on' } = '' ;
712 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
713 $checked { 'TIME_FRI' }{ 'off' } = '' ;
714 $checked { 'TIME_FRI' }{ 'on' } = '' ;
715 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
716 $checked { 'TIME_SAT' }{ 'off' } = '' ;
717 $checked { 'TIME_SAT' }{ 'on' } = '' ;
718 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
719 $checked { 'TIME_SUN' }{ 'off' } = '' ;
720 $checked { 'TIME_SUN' }{ 'on' } = '' ;
721 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
723 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
724 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
725 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
726 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
728 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
729 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
730 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
731 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
732 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
733 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
734 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
735 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
736 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
738 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
739 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
740 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
742 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
743 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
744 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
746 foreach ( @useragentlist ) {
747 @useragent = split ( /,/ );
748 $checked { 'UA_' . @useragent [ 0 ]}{ 'off' } = '' ;
749 $checked { 'UA_' . @useragent [ 0 ]}{ 'on' } = '' ;
750 $checked { 'UA_' . @useragent [ 0 ]}{ $proxysettings { 'UA_' . @useragent [ 0 ]}} = "checked='checked'" ;
753 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
754 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
755 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
756 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
757 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
758 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
759 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
761 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
763 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
764 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
765 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
767 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
768 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
769 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
771 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
773 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
775 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
777 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
778 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
779 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
781 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
782 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
783 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
785 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
786 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
787 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
789 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
790 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
791 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
793 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
794 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
795 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
797 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
798 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
799 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
801 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
802 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
803 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
805 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
806 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
807 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
809 if ( $urlfilter_addon ) {
810 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
811 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
812 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
815 if ( $updaccel_addon ) {
816 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
817 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
818 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
821 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
823 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
826 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
827 print "<font class='base'> $errormessage </font> \n " ;
831 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
833 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
834 $squidversion [ 0 ] =~ s/^\s+//g ;
835 $squidversion [ 0 ] =~ s/\s+$//g ;
837 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
840 # ===================================================================
842 # ===================================================================
844 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
846 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
848 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
853 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
856 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
857 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
858 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
859 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
862 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
863 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
864 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
865 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
870 if ( $netsettings { 'BLUE_DEV' }) {
871 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
872 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
874 print "<td colspan='2'> </td>" ;
877 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
878 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
883 if ( $netsettings { 'BLUE_DEV' }) {
884 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
885 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
887 print "<td colspan='2'> </td>" ;
890 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
892 <select name='ERR_LANGUAGE'>
895 foreach (< $errordir /*>) {
897 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
898 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
906 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
907 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
908 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
909 <td class='base'><select name='ERR_DESIGN'>
910 <option value='ipcop' $selected {'ERR_DESIGN'}{'ipcop'}>IPCop</option>
911 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
915 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
916 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
924 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
927 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}:</td>
928 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
929 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'} <img src='/blob.gif' alt='*' /></td>
930 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
933 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td>
934 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
935 <td class='base'> $Lang ::tr{'advproxy upstream username'}: <img src='/blob.gif' alt='*' /></td>
936 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
939 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td>
940 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
941 <td class='base'> $Lang ::tr{'advproxy upstream password'}: <img src='/blob.gif' alt='*' /></td>
942 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
945 <td class='base'> $Lang ::tr{'advproxy no connection auth'}:</td>
946 <td><input type='checkbox' name='NO_CONNECTION_AUTH' $checked {'NO_CONNECTION_AUTH'}{'on'} /></td>
954 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
957 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
958 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
959 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
960 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
965 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
966 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
972 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
975 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
978 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
979 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
980 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
981 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
984 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
985 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
986 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
987 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
990 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
991 <td class='base'><select name='L1_DIRS'>
992 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
993 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
994 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
995 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
996 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
998 <td colspan='2' rowspan= '5' valign='top' class='base'>
999 <table cellspacing='0' cellpadding='0'>
1001 <!-- intentionally left empty -->
1004 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
1007 <!-- intentionally left empty -->
1010 <!-- intentionally left empty -->
1013 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1017 print $proxysettings { 'DST_NOCACHE' };
1026 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1027 <td class='base'><select name='MEM_POLICY'>
1028 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1029 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1030 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1031 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1035 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1036 <td class='base'><select name='CACHE_POLICY'>
1037 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1038 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1039 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1040 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1044 <td colspan='2'> </td>
1047 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1048 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1052 <table width='100%'>
1054 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1057 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1060 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}:</td>
1061 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}:</td>
1064 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1067 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1071 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1074 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1081 <table width='100%'>
1083 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1086 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1089 <td colspan='2' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1090 <td colspan='2'> </td>
1093 <td colspan='2'><textarea name='SRC_SUBNETS' cols='32' rows='6' wrap='off'>
1097 if (! $proxysettings { 'SRC_SUBNETS' })
1099 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1100 if ( $netsettings { 'BLUE_DEV' })
1102 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1104 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1108 <td colspan='2'> </td>
1111 <table width='100%'>
1113 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1116 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1117 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1120 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='6' wrap='off'>
1124 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1128 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='6' wrap='off'>
1132 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1138 <table width='100%'>
1140 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1143 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1144 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1147 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='6' wrap='off'>
1151 print $proxysettings { 'SRC_BANNED_IP' };
1155 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='6' wrap='off'>
1159 print $proxysettings { 'SRC_BANNED_MAC' };
1170 # -------------------------------------------------------------------
1171 # CRE GUI - optional
1172 # -------------------------------------------------------------------
1174 if (- e
$cre_enabled ) { print <<END
1175 <table width='100%'>
1178 <td colspan='4'><b> $Lang ::tr{'advproxy classroom extensions'}</b></td>
1181 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1184 <td class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1185 <td><input type='checkbox' name='CLASSROOM_EXT' $checked {'CLASSROOM_EXT'}{'on'} /></td>
1186 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1187 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1190 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1191 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1194 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1198 print $proxysettings { 'CRE_GROUPS' };
1202 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1205 print $proxysettings { 'CRE_SVHOSTS' };
1218 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1219 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1220 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1225 # -------------------------------------------------------------------
1229 <table width='100%'>
1231 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1233 <table width='100%'>
1235 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1236 <td width='1%'> </td>
1237 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1238 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1239 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1240 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1241 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1242 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1243 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1244 <td width='1%'> </td>
1245 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1246 <td width='1%'> </td>
1247 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1252 <select name='TIME_ACCESS_MODE'>
1253 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1254 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1258 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1259 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1260 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1261 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1262 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1263 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1264 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1267 <select name='TIME_FROM_HOUR'>
1270 for ( $i = 0 ; $i <= 24 ; $i ++) {
1271 $_ = sprintf ( " %02s " , $i );
1272 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1279 <select name='TIME_FROM_MINUTE'>
1282 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1283 $_ = sprintf ( " %02s " , $i );
1284 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1291 <select name='TIME_TO_HOUR'>
1294 for ( $i = 0 ; $i <= 24 ; $i ++) {
1295 $_ = sprintf ( " %02s " , $i );
1296 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1303 <select name='TIME_TO_MINUTE'>
1306 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1307 $_ = sprintf ( " %02s " , $i );
1308 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1316 <table width='100%'>
1318 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1321 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1322 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1323 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1324 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1328 <table width='100%'>
1330 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1333 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1334 <td width='20%' class='base'>
1335 <select name='THROTTLING_GREEN_TOTAL'>
1339 foreach ( @throttle_limits ) {
1340 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1344 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1347 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1348 <td width='30%' class='base'>
1349 <select name='THROTTLING_GREEN_HOST'>
1353 foreach ( @throttle_limits ) {
1354 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1358 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1365 if ( $netsettings { 'BLUE_DEV' }) {
1368 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1370 <select name='THROTTLING_BLUE_TOTAL'>
1374 foreach ( @throttle_limits ) {
1375 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1379 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1382 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1384 <select name='THROTTLING_BLUE_HOST'>
1388 foreach ( @throttle_limits ) {
1389 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1393 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1403 <table width='100%'>
1405 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1408 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1409 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1410 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1411 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1412 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1413 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1414 <td width='15%'> </td>
1415 <td width='10%'> </td>
1419 <table width='100%'>
1421 <td colspan='4'><b> $Lang ::tr{'advproxy MIME filter'}</b></td>
1424 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1425 <td width='20%'><input type='checkbox' name='ENABLE_MIME_FILTER' $checked {'ENABLE_MIME_FILTER'}{'on'} /></td>
1428 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1433 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1437 print $proxysettings { 'MIME_TYPES' };
1446 <table width='100%'>
1448 <td colspan='4'><b> $Lang ::tr{'advproxy web browser'}</b></td>
1451 <td width='25%' class='base'> $Lang ::tr{'advproxy UA enable filter'}:</td>
1452 <td width='20%'><input type='checkbox' name='ENABLE_BROWSER_CHECK' $checked {'ENABLE_BROWSER_CHECK'}{'on'} /></td>
1460 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1465 <table width='100%'>
1469 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1470 for ( $i = 0 ; $i <= 3 ; $i ++) {
1471 if ( $i eq 0 ) { print "<tr> \n " ; }
1472 if (( $n + $i ) < @useragentlist ) {
1473 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1474 print "<td width='15%'> @useragent [1]:<\/td> \n " ;
1475 print "<td width='10%'><input type='checkbox' name='UA_ @useragent [0]' $checked {'UA_'. @useragent [0]}{'on'} /></td> \n " ;
1477 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1484 <table width='100%'>
1486 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1489 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1492 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='56' /></td>
1495 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1498 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='56' /></td>
1505 if ( $urlfilter_addon ) {
1507 <table width='100%'>
1509 <td class='base' colspan='4'><b> $Lang ::tr{'advproxy url filter'}</b> [<font color=' $Header ::colourred'> $urlfilterversion </font>]</td>
1512 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1513 <td class='base' width='20%'><input type='checkbox' name='ENABLE_FILTER' $checked {'ENABLE_FILTER'}{'on'} /></td>
1522 if ( $updaccel_addon ) {
1524 <table width='100%'>
1526 <td class='base' colspan='4'><b> $Lang ::tr{'advproxy update accelerator'}</b> [<font color=' $Header ::colourred'> $updaccelversion </font>]</td>
1529 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1530 <td class='base' width='20%'><input type='checkbox' name='ENABLE_UPDXLRATOR' $checked {'ENABLE_UPDXLRATOR'}{'on'} /></td>
1540 <table width='100%'>
1542 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1545 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1546 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1547 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1548 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1549 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1550 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1556 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1558 <table width='100%'>
1560 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1563 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1566 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1567 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1568 <td colspan='2' rowspan= '6' valign='top' class='base'>
1569 <table cellpadding='0' cellspacing='0'>
1571 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1574 <!-- intentionally left empty -->
1577 <!-- intentionally left empty -->
1580 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1583 <!-- intentionally left empty -->
1586 <!-- intentionally left empty -->
1589 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1592 <!-- intentionally left empty -->
1595 <!-- intentionally left empty -->
1598 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1602 print $proxysettings { 'DST_NOAUTH' };
1611 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1612 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1615 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1616 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1619 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1620 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1623 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1624 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1627 <td colspan='2'> </td>
1634 # ===================================================================
1635 # NCSA auth settings
1636 # ===================================================================
1638 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1641 <table width='100%'>
1643 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1646 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1647 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1648 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1649 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1652 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1660 # ===================================================================
1661 # IDENTD auth settings
1662 # ===================================================================
1664 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1667 <table width='100%'>
1669 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1672 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1673 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1674 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1675 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1678 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1679 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1684 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1685 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1688 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1691 if (! $proxysettings { 'IDENT_HOSTS' }) {
1692 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1693 if ( $netsettings { 'BLUE_DEV' }) {
1694 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1697 print $proxysettings { 'IDENT_HOSTS' };
1702 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1706 print $proxysettings { 'DST_NOAUTH' };
1713 <table width='100%'>
1715 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1718 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1719 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1720 <td width='25%'> </td>
1721 <td width='30%'> </td>
1724 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1725 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1726 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1727 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1730 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1731 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1734 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1738 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1740 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1742 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1746 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1748 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1755 # ===================================================================
1756 # NTLM auth settings
1757 # ===================================================================
1759 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1762 <table width='100%'>
1764 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1767 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1768 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1769 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1770 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1771 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1772 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1776 <table width='100%'>
1778 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1781 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1782 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1787 <table width='100%'>
1789 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1792 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1793 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1794 <td width='25%'> </td>
1795 <td width='30%'> </td>
1798 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1799 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1800 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1801 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1804 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1805 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1808 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1812 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1814 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1816 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1820 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1822 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1829 # ===================================================================
1830 # LDAP auth settings
1831 # ===================================================================
1833 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1836 <table width='100%'>
1838 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1841 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1842 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1843 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1844 <td class='base'><select name='LDAP_TYPE'>
1845 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1846 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1847 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1848 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1852 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1853 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1854 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1855 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1859 <table width='100%'>
1861 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1864 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1865 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1866 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1867 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1871 <table width='100%'>
1873 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1876 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
1877 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1885 # ===================================================================
1886 # RADIUS auth settings
1887 # ===================================================================
1889 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1892 <table width='100%'>
1894 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1897 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1898 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1899 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1900 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1903 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
1904 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1905 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1906 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1910 <table width='100%'>
1912 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1915 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1916 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1917 <td width='25%'> </td>
1918 <td width='30%'> </td>
1921 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1922 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1923 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1924 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1927 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1928 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1931 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1935 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
1937 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1939 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
1943 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
1945 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1952 # ===================================================================
1958 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
1960 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1961 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1962 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1963 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1964 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
1965 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1966 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
1970 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
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_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1980 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
1982 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
1983 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
1987 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
1989 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
1990 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
1991 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
1992 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
1993 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
1994 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
1995 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
1999 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2001 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2002 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2003 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2004 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2005 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2006 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2007 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2011 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
2013 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
2014 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
2015 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
2016 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
2017 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
2018 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
2019 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
2020 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
2024 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2026 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2027 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2028 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2029 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2030 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2031 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2032 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2033 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2045 <table width='100%'>
2048 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2049 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2050 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2056 <table width='100%'>
2058 <td><img src='/blob.gif' align='top' alt='*' />
2059 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2061 <td align='right'> </td>
2068 & Header
:: closebox
();
2072 # ===================================================================
2073 # NCSA user management
2074 # ===================================================================
2076 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2078 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2079 <table width='100%'>
2081 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2084 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2085 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2088 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly " ; }
2091 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2093 <select name='NCSA_GROUP'>
2094 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2095 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2096 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2102 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2103 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2104 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2105 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2112 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2113 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2114 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2117 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2118 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2124 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2129 <table width='100%'>
2131 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2134 <table width='100%' align='center'>
2140 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2141 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2145 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2146 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2150 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2151 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2154 @userlist = sort ( @userlist );
2156 # If the password file contains entries, print entries and action icons
2158 if (! - z
" $userdb " ) {
2161 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2162 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2163 <td class='boldbase' colspan='2' align='center'> </td>
2168 foreach $line ( @userlist )
2172 @temp = split ( /:/ , $line );
2173 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2174 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2176 print "<tr bgcolor=' $Header ::table1colour'> \n " ; }
2178 print "<tr bgcolor=' $Header ::table2colour'> \n " ; }
2181 <td align='center'> $temp [0]</td>
2185 if ( $temp [ 1 ] eq 'standard' ) {
2186 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2187 } elsif ( $temp [ 1 ] eq 'extended' ) {
2188 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2189 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2190 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2193 <td width='8%' align='center'>
2194 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2195 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2196 <input type='hidden' name='ID' value=' $line ' />
2197 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2201 <td width='8%' align='center'>
2202 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2203 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2204 <input type='hidden' name='ID' value=' $temp [0]' />
2205 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2216 <table width='100%'>
2218 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2219 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2220 <td class='base'> $Lang ::tr{'edit'}</td>
2221 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2222 <td class='base'> $Lang ::tr{'remove'}</td>
2229 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2240 & Header
:: closebox
();
2244 # ===================================================================
2246 & Header
:: closebigbox
();
2248 & Header
:: closepage
();
2250 # -------------------------------------------------------------------
2254 if (- e
" $acl_src_subnets " ) {
2255 open ( FILE
, " $acl_src_subnets " );
2256 delete $proxysettings { 'SRC_SUBNETS' };
2257 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2260 if (- e
" $acl_src_banned_ip " ) {
2261 open ( FILE
, " $acl_src_banned_ip " );
2262 delete $proxysettings { 'SRC_BANNED_IP' };
2263 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2266 if (- e
" $acl_src_banned_mac " ) {
2267 open ( FILE
, " $acl_src_banned_mac " );
2268 delete $proxysettings { 'SRC_BANNED_MAC' };
2269 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2272 if (- e
" $acl_src_unrestricted_ip " ) {
2273 open ( FILE
, " $acl_src_unrestricted_ip " );
2274 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2275 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2278 if (- e
" $acl_src_unrestricted_mac " ) {
2279 open ( FILE
, " $acl_src_unrestricted_mac " );
2280 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2281 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2284 if (- e
" $acl_dst_nocache " ) {
2285 open ( FILE
, " $acl_dst_nocache " );
2286 delete $proxysettings { 'DST_NOCACHE' };
2287 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2290 if (- e
" $acl_dst_noauth " ) {
2291 open ( FILE
, " $acl_dst_noauth " );
2292 delete $proxysettings { 'DST_NOAUTH' };
2293 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2296 if (- e
" $acl_ports_safe " ) {
2297 open ( FILE
, " $acl_ports_safe " );
2298 delete $proxysettings { 'PORTS_SAFE' };
2299 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2302 if (- e
" $acl_ports_ssl " ) {
2303 open ( FILE
, " $acl_ports_ssl " );
2304 delete $proxysettings { 'PORTS_SSL' };
2305 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2308 if (- e
" $mimetypes " ) {
2309 open ( FILE
, " $mimetypes " );
2310 delete $proxysettings { 'MIME_TYPES' };
2311 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2314 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2315 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2316 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2317 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2320 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2321 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2322 delete $proxysettings { 'NTLM_DENY_USERS' };
2323 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2326 if (- e
" $raddir /radauth.allowusers" ) {
2327 open ( FILE
, " $raddir /radauth.allowusers" );
2328 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2329 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2332 if (- e
" $raddir /radauth.denyusers" ) {
2333 open ( FILE
, " $raddir /radauth.denyusers" );
2334 delete $proxysettings { 'RADIUS_DENY_USERS' };
2335 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2338 if (- e
" $identdir /identauth.allowusers" ) {
2339 open ( FILE
, " $identdir /identauth.allowusers" );
2340 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2341 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2344 if (- e
" $identdir /identauth.denyusers" ) {
2345 open ( FILE
, " $identdir /identauth.denyusers" );
2346 delete $proxysettings { 'IDENT_DENY_USERS' };
2347 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2350 if (- e
" $identhosts " ) {
2351 open ( FILE
, " $identhosts " );
2352 delete $proxysettings { 'IDENT_HOSTS' };
2353 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2356 if (- e
" $cre_groups " ) {
2357 open ( FILE
, " $cre_groups " );
2358 delete $proxysettings { 'CRE_GROUPS' };
2359 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2362 if (- e
" $cre_svhosts " ) {
2363 open ( FILE
, " $cre_svhosts " );
2364 delete $proxysettings { 'CRE_SVHOSTS' };
2365 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2370 # -------------------------------------------------------------------
2374 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2375 undef $proxysettings { 'PORTS_SAFE' };
2378 s/^\s+//g ; s/\s+$//g ;
2382 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2384 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2385 @templist = split ( /-/ );
2386 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2387 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2391 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2392 undef $proxysettings { 'PORTS_SSL' };
2395 s/^\s+//g ; s/\s+$//g ;
2400 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2401 @templist = split ( /-/ );
2402 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2403 $proxysettings { 'PORTS_SSL' } .= $line . " \n " ;
2407 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2408 undef $proxysettings { 'DST_NOCACHE' };
2411 s/^\s+//g ; s/\s+$//g ;
2414 unless ( /^\./ ) { $_ = '.' . $_ ; }
2415 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2419 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2420 undef $proxysettings { 'SRC_SUBNETS' };
2423 s/^\s+//g ; s/\s+$//g ;
2426 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2427 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2431 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2432 undef $proxysettings { 'SRC_BANNED_IP' };
2435 s/^\s+//g ; s/\s+$//g ;
2438 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2439 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2443 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2444 undef $proxysettings { 'SRC_BANNED_MAC' };
2447 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2450 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2451 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2455 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2456 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2459 s/^\s+//g ; s/\s+$//g ;
2462 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2463 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2467 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2468 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2471 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2474 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2475 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2479 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2480 undef $proxysettings { 'DST_NOAUTH' };
2483 s/^\s+//g ; s/\s+$//g ;
2486 unless ( /^\./ ) { $_ = '.' . $_ ; }
2487 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2491 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2493 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2494 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2497 s/^\s+//g ; s/\s+$//g ;
2498 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2500 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2503 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2505 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2506 undef $proxysettings { 'NTLM_DENY_USERS' };
2509 s/^\s+//g ; s/\s+$//g ;
2510 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2512 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2515 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2517 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2518 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2521 s/^\s+//g ; s/\s+$//g ;
2522 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2524 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2527 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2529 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2530 undef $proxysettings { 'IDENT_DENY_USERS' };
2533 s/^\s+//g ; s/\s+$//g ;
2534 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2536 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2539 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2541 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2542 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2545 s/^\s+//g ; s/\s+$//g ;
2546 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2548 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2551 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2553 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2554 undef $proxysettings { 'RADIUS_DENY_USERS' };
2557 s/^\s+//g ; s/\s+$//g ;
2558 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2560 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2563 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2564 undef $proxysettings { 'IDENT_HOSTS' };
2567 s/^\s+//g ; s/\s+$//g ;
2570 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2571 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2575 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2576 undef $proxysettings { 'CRE_SVHOSTS' };
2579 s/^\s+//g ; s/\s+$//g ;
2582 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2583 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2588 # -------------------------------------------------------------------
2592 open ( FILE
, "> $acl_src_subnets " );
2594 if (! $proxysettings { 'SRC_SUBNETS' })
2596 print FILE
" $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
2597 if ( $netsettings { 'BLUE_DEV' })
2599 print FILE
" $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
2601 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2604 open ( FILE
, "> $acl_src_banned_ip " );
2606 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2609 open ( FILE
, "> $acl_src_banned_mac " );
2611 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2614 open ( FILE
, "> $acl_src_unrestricted_ip " );
2616 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2619 open ( FILE
, "> $acl_src_unrestricted_mac " );
2621 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2624 open ( FILE
, "> $acl_dst_nocache " );
2626 print FILE
$proxysettings { 'DST_NOCACHE' };
2629 open ( FILE
, "> $acl_dst_noauth " );
2631 print FILE
$proxysettings { 'DST_NOAUTH' };
2634 open ( FILE
, "> $acl_ports_safe " );
2636 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2639 open ( FILE
, "> $acl_ports_ssl " );
2641 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2644 open ( FILE
, "> $acl_dst_throttle " );
2646 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2648 @temp = split ( /\|/ , $throttle_binary );
2649 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2651 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2653 @temp = split ( /\|/ , $throttle_dskimg );
2654 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2656 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2658 @temp = split ( /\|/ , $throttle_mmedia );
2659 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2661 if (- s
$throttled_urls )
2663 open ( URLFILE
, $throttled_urls );
2666 foreach ( @temp ) { print FILE
; }
2670 open ( FILE
, "> $mimetypes " );
2672 print FILE
$proxysettings { 'MIME_TYPES' };
2675 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2677 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2680 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2682 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2685 open ( FILE
, "> $raddir /radauth.allowusers" );
2687 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2690 open ( FILE
, "> $raddir /radauth.denyusers" );
2692 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2695 open ( FILE
, "> $identdir /identauth.allowusers" );
2697 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2700 open ( FILE
, "> $identdir /identauth.denyusers" );
2702 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2705 open ( FILE
, "> $identhosts " );
2707 print FILE
$proxysettings { 'IDENT_HOSTS' };
2710 open ( FILE
, "> $cre_groups " );
2712 print FILE
$proxysettings { 'CRE_GROUPS' };
2715 open ( FILE
, "> $cre_svhosts " );
2717 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2721 # -------------------------------------------------------------------
2725 open ( FILE
, ">/home/httpd/html/proxy.pac" );
2727 print FILE
"function FindProxyForURL(url, host) \n " ;
2729 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2733 (isPlainHostName(host)) ||
2734 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2735 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2736 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2737 (isInNet(host, "169.254.0.0", "255.255.0.0")) ||
2738 (isInNet(host, "192.168.0.0", "255.255.0.0"))
2746 if ( $proxysettings { 'ENABLE' } eq 'on' )
2750 (isInNet(myIpAddress(), " $netsettings {'GREEN_NETADDRESS'}", " $netsettings {'GREEN_NETMASK'}"))
2752 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2756 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2758 print FILE
" \n else \n\n " ;
2760 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2764 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2766 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2775 # -------------------------------------------------------------------
2782 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2783 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2784 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2785 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2787 $delaypools = 1 ; } else { $delaypools = 0 ;
2790 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2792 $authrealm = "IPCop Advanced Proxy Server" ;
2794 $authrealm = $proxysettings { 'AUTH_REALM' };
2797 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2798 my ( $remotehost , $remoteport ) = ( /^(?:[a-zA-Z ]+\:\/ \
/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/ .* ?
) ?
$/);
2800 if ( $remoteport eq '' ) { $remoteport = 80 ; }
2802 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
2805 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
2806 # you make will be overwritten whenever you resave proxy settings using the
2809 # Instead, modify the file ' $acl_include ' and
2810 # then restart the proxy service using the web interface. Changes made to the
2811 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
2813 shutdown_lifetime 5 seconds
2818 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2819 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) { print FILE
" transparent" }
2820 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2823 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
2824 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2825 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) { print FILE
" transparent" }
2826 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2832 acl QUERY urlpath_regex cgi-bin \\ ?
2836 if (!- z
$acl_dst_nocache ) {
2837 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache \"\n " ;
2838 print FILE
"cache deny no_cache_domains \n " ;
2843 cache_effective_user squid
2844 cache_effective_group squid
2847 pid_filename /var/run/squid.pid
2849 cache_mem $proxysettings {'CACHE_MEM'} MB
2850 cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256
2855 if (( $proxysettings { 'ERR_DESIGN' } eq 'ipcop' ) && ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' ))
2857 print FILE
"error_directory $errordir .ipcop/ $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2859 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2862 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
2864 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
2866 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
2868 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
2870 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
2872 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
2877 if ( $proxysettings { 'LOGGING' } eq 'on' )
2880 access_log /var/log/squid/access.log
2881 cache_log /var/log/squid/cache.log
2882 cache_store_log none
2885 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"useragent_log \/var\/log\/squid\/user_agent.log \n " ; }
2886 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
2889 access_log /dev/null
2891 cache_store_log none
2900 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
2902 print FILE
"forwarded_for on \n " ;
2904 print FILE
"forwarded_for off \n " ;
2906 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
2908 print FILE
"via on \n " ;
2910 print FILE
"via off \n " ;
2914 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
2916 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
2918 print FILE
"auth_param basic program $authdir /ncsa_auth $userdb \n " ;
2919 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2920 print FILE
"auth_param basic realm $authrealm \n " ;
2921 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2922 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2925 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
2927 print FILE
"auth_param basic program $authdir /squid_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
2928 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
2929 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
2930 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
2932 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2934 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
2936 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2938 print FILE
" -u sAMAccountName -P" ;
2940 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
2942 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2944 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
2946 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
2948 print FILE
" -u cn -P" ;
2950 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
2952 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2954 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
2956 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2958 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
2959 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
2960 print FILE
" -u uid -P" ;
2962 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
2963 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2964 print FILE
"auth_param basic realm $authrealm \n " ;
2965 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2966 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2969 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
2971 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
2973 print FILE
"auth_param ntlm program $authdir /ntlm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
2974 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
2975 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
2976 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2978 print FILE
"auth_param basic program $authdir /msnt_auth \n " ;
2979 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2980 print FILE
"auth_param basic realm $authrealm \n " ;
2981 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2982 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2984 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
2986 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
2987 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
2988 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
2989 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
2991 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
2993 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
2995 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
3002 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3004 print FILE
"auth_param basic program $authdir /squid_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3005 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3006 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3007 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3008 print FILE
"auth_param basic realm $authrealm \n " ;
3009 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3010 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3014 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3015 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
3017 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
3019 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
3021 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
3023 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
3026 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3028 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3030 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3032 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3034 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3037 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3040 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3041 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3043 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3046 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3050 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3052 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3054 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3056 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3058 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3060 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3062 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3064 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3067 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3071 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3073 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
3075 print FILE
"acl within_timeframe time " ;
3076 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3077 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3078 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3079 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3080 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3081 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3082 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3083 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3084 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3085 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3086 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3088 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3089 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3093 acl all src 0.0.0.0/0.0.0.0
3094 acl localhost src 127.0.0.1/255.255.255.255
3097 open ( PORTS
, " $acl_ports_ssl " );
3102 foreach ( @temp ) { print FILE
"acl SSL_ports port $_ " ; }
3104 open ( PORTS
, " $acl_ports_safe " );
3109 foreach ( @temp ) { print FILE
"acl Safe_ports port $_ " ; }
3113 acl IPCop_http port $http_port
3114 acl IPCop_https port $https_port
3115 acl IPCop_ips dst $netsettings {'GREEN_ADDRESS'}
3116 acl IPCop_networks src " $acl_src_subnets "
3117 acl IPCop_green_network src $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3120 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_network src $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3121 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPCop_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3122 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPCop_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3123 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPCop_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3124 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPCop_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3126 acl CONNECT method CONNECT
3130 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3133 #Classroom extensions
3134 acl IPCop_no_access_ips src " $acl_src_noaccess_ip "
3135 acl IPCop_no_access_mac arp " $acl_src_noaccess_mac "
3138 print FILE
"deny_info " ;
3139 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipcop' ) && (- e
" $errordir .ipcop/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3140 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3142 print FILE
"ERR_ACCESS_DISABLED" ;
3144 print FILE
"ERR_ACCESS_DENIED" ;
3146 print FILE
" IPCop_no_access_ips \n " ;
3147 print FILE
"deny_info " ;
3148 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipcop' ) && (- e
" $errordir .ipcop/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3149 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3151 print FILE
"ERR_ACCESS_DISABLED" ;
3153 print FILE
"ERR_ACCESS_DENIED" ;
3155 print FILE
" IPCop_no_access_mac \n " ;
3158 http_access deny IPCop_no_access_ips
3159 http_access deny IPCop_no_access_mac
3164 #Insert acl file and replace __VAR__ with correct values
3165 my $blue_net = '' ; #BLUE empty by default
3167 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3168 $blue_net = " $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'}" ;
3169 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3171 if (!- z
$acl_include )
3173 open ( ACL
, " $acl_include " );
3174 print FILE
" \n #Start of custom includes \n " ;
3176 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3177 $_ =~ s/__GREEN_NET__/$netsettings{'GREEN_NETADDRESS'}\/ $netsettings { 'GREEN_NETMASK' }/;
3178 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3179 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3180 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3183 print FILE
"#End of custom includes \n " ;
3186 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3190 #local machine, no restriction
3191 http_access allow localhost
3193 #GUI admin if local machine connects
3194 http_access allow IPCop_ips IPCop_networks IPCop_http
3195 http_access allow CONNECT IPCop_ips IPCop_networks IPCop_https
3197 #Deny not web services
3198 http_access deny !Safe_ports
3199 http_access deny CONNECT !SSL_ports
3204 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3206 print FILE
"#Set ident ACLs \n " ;
3207 if (!- z
$identhosts )
3209 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3210 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3211 print FILE
"ident_lookup_access deny all \n " ;
3213 print FILE
"ident_lookup_access allow all \n " ;
3215 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3219 print FILE
"#Set download throttling \n " ;
3221 if ( $netsettings { 'BLUE_DEV' })
3223 print FILE
"delay_pools 2 \n " ;
3225 print FILE
"delay_pools 1 \n " ;
3228 print FILE
"delay_class 1 3 \n " ;
3229 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3231 print FILE
"delay_parameters 1 " ;
3232 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3236 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3238 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3241 print FILE
" -1/-1 " ;
3242 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3246 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3248 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3252 if ( $netsettings { 'BLUE_DEV' })
3254 print FILE
"delay_parameters 2 " ;
3255 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3259 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3261 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3263 print FILE
" -1/-1 " ;
3264 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3268 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3270 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3275 print FILE
"delay_access 1 deny IPCop_ips \n " ;
3276 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPCop_unrestricted_ips \n " ; }
3277 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPCop_unrestricted_mac \n " ; }
3278 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3280 if ( $netsettings { 'BLUE_DEV' })
3282 print FILE
"delay_access 1 allow IPCop_green_network" ;
3283 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3285 print FILE
"delay_access 1 deny all \n " ;
3287 print FILE
"delay_access 1 allow all" ;
3288 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3292 if ( $netsettings { 'BLUE_DEV' })
3294 print FILE
"delay_access 2 deny IPCop_ips \n " ;
3295 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPCop_unrestricted_ips \n " ; }
3296 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPCop_unrestricted_mac \n " ; }
3297 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3298 print FILE
"delay_access 2 allow IPCop_blue_network" ;
3299 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3301 print FILE
"delay_access 2 deny all \n " ;
3304 print FILE
"delay_initial_bucket_level 100% \n " ;
3308 #Set custom configured ACLs
3311 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPCop_banned_ips \n " ; }
3312 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPCop_banned_mac \n " ; }
3314 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3316 if (!- z
$acl_src_unrestricted_ip )
3318 print FILE
"http_access allow IPCop_unrestricted_ips to_domains_without_auth \n " ;
3320 if (!- z
$acl_src_unrestricted_mac )
3322 print FILE
"http_access allow IPCop_unrestricted_mac to_domains_without_auth \n " ;
3324 print FILE
"http_access allow IPCop_networks" ;
3325 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3326 print FILE
" !within_timeframe" ;
3328 print FILE
" within_timeframe" ; }
3329 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3330 print FILE
" to_domains_without_auth \n " ;
3333 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3335 print FILE
"http_access deny !for_inetusers" ;
3336 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3341 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3342 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3343 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3344 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3345 (!- z
" $identdir /identauth.denyusers" )
3348 print FILE
"http_access deny for_acl_users" ;
3349 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3353 if (!- z
$acl_src_unrestricted_ip )
3355 print FILE
"http_access allow IPCop_unrestricted_ips" ;
3356 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3358 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3360 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3362 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3364 print FILE
" for_inetusers" ;
3366 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3368 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3370 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3372 print FILE
" for_acl_users" ;
3374 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3376 print FILE
" !for_acl_users" ;
3378 } else { print FILE
" for_inetusers" ; }
3380 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3382 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3384 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3386 print FILE
" for_acl_users" ;
3388 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3390 print FILE
" !for_acl_users" ;
3392 } else { print FILE
" for_inetusers" ; }
3398 if (!- z
$acl_src_unrestricted_mac )
3400 print FILE
"http_access allow IPCop_unrestricted_mac" ;
3401 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3403 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3405 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3407 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3409 print FILE
" for_inetusers" ;
3411 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3413 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3415 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3417 print FILE
" for_acl_users" ;
3419 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3421 print FILE
" !for_acl_users" ;
3423 } else { print FILE
" for_inetusers" ; }
3425 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3427 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3429 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3431 print FILE
" for_acl_users" ;
3433 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3435 print FILE
" !for_acl_users" ;
3437 } else { print FILE
" for_inetusers" ; }
3443 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3445 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3446 if (!- z
$extgrp ) { print FILE
"http_access allow IPCop_networks for_extended_users \n " ; }
3451 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3452 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3453 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3454 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3455 (!- z
" $ntlmdir /msntauth.denyusers" )
3459 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3460 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3461 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3462 (!- z
" $raddir /radauth.denyusers" )
3466 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3467 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3468 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3469 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3470 (!- z
" $identdir /identauth.denyusers" )
3474 print FILE
"http_access deny for_acl_users" ;
3475 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3479 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3481 print FILE
"http_access allow" ;
3482 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3483 print FILE
" !within_timeframe" ;
3485 print FILE
" within_timeframe" ; }
3486 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3487 print FILE
" !on_ident_aware_hosts \n " ;
3490 print FILE
"http_access allow IPCop_networks" ;
3493 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3494 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3495 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3496 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3497 (!- z
" $ntlmdir /msntauth.allowusers" )
3501 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3502 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3503 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3504 (!- z
" $raddir /radauth.allowusers" )
3508 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3509 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3510 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3511 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3512 (!- z
" $identdir /identauth.allowusers" )
3516 print FILE
" for_acl_users" ;
3517 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3518 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3519 print FILE
" for_inetusers" ;
3521 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3523 print FILE
" !concurrent" ;
3525 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3526 print FILE
" !within_timeframe" ;
3528 print FILE
" within_timeframe" ; }
3529 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3532 print FILE
"http_access deny all \n\n " ;
3534 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3535 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3537 print FILE
"#Strip HTTP Header \n " ;
3539 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3541 print FILE
"header_access X-Forwarded-For deny all \n " ;
3543 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3545 print FILE
"header_access Via deny all \n " ;
3547 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3549 print FILE
"header_access User-Agent deny all \n " ;
3551 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3553 print FILE
"header_access Referer deny all \n " ;
3558 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3560 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3562 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3564 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3566 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3572 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3574 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3575 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPCop_unrestricted_ips \n " ; }
3576 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPCop_unrestricted_mac \n " ; }
3577 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3579 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3581 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3582 print FILE
"http_reply_access allow all \n\n " ;
3586 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3587 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3589 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3592 $replybodymaxsize = 1024 * $proxysettings { 'MAX_INCOMING_SIZE' };
3593 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3594 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_ips \n " ; }
3595 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_mac \n " ; }
3596 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3598 if (!- z
$extgrp ) { print FILE
"reply_body_max_size 0 allow for_extended_users \n " ; }
3601 print FILE
"reply_body_max_size $replybodymaxsize allow all \n\n " ;
3603 print FILE
"visible_hostname" ;
3604 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3606 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3608 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3611 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n\n " ; }
3613 # Write the parent proxy info, if needed.
3614 if ( $remotehost ne '' )
3616 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3618 # Enter authentication for the parent cache. Option format is
3619 # login=user:password ($proxy1='YES')
3620 # login=PASS ($proxy1='PASS')
3621 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3622 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3624 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3625 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3627 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3629 print FILE
" \n never_direct allow all \n\n " ;
3631 if (( $urlfilter_addon ) && ( $updaccel_addon ) && ( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) && ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ))
3633 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3634 if ( $filtersettings { 'CHILDREN' } > $updaccelsettings { 'CHILDREN' })
3636 print FILE
"url_rewrite_children $filtersettings {'CHILDREN'} \n\n " ;
3638 print FILE
"url_rewrite_children $updaccelsettings {'CHILDREN'} \n\n " ;
3642 if ( $urlfilter_addon ) {
3643 if ( $proxysettings { 'ENABLE_FILTER' } eq 'on' )
3646 url_rewrite_program /usr/sbin/squidGuard
3647 url_rewrite_children $filtersettings {'CHILDREN'}
3653 if ( $updaccel_addon ) {
3654 if ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' )
3657 url_rewrite_program /usr/sbin/updxlrator
3658 url_rewrite_children $updaccelsettings {'CHILDREN'}
3668 # -------------------------------------------------------------------
3672 my ( $str_user , $str_pass , $str_group ) = @_ ;
3673 my @groupmembers =();
3675 if ( $str_pass eq 'lEaVeAlOnE' )
3677 open ( FILE
, " $userdb " );
3678 @groupmembers = < FILE
>;
3680 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3681 & deluser
( $str_user );
3682 open ( FILE
, ">> $userdb " );
3684 print FILE
" $str_user $str_pass " ;
3687 & deluser
( $str_user );
3688 system ( "/usr/bin/htpasswd -b $userdb $str_user $str_pass " );
3691 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3692 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3693 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3695 print FILE
" $str_user \n " ;
3701 # -------------------------------------------------------------------
3705 my ( $str_user ) = @_ ;
3707 my @groupmembers =();
3710 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3713 open ( FILE
, " $groupfile " );
3714 @groupmembers = < FILE
>;
3716 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3717 open ( FILE
, "> $groupfile " );
3719 print FILE
@templist ;
3724 open ( FILE
, " $userdb " );
3725 @groupmembers = < FILE
>;
3727 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3728 open ( FILE
, "> $userdb " );
3730 print FILE
@templist ;
3736 # -------------------------------------------------------------------