]>
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 1.2.1 2006/04/02 00:00:00 marco.s Exp $
12 # enable only the following on debugging purpose
14 #use CGI::Carp 'fatalsToBrowser';
18 require '/var/ipfire/general-functions.pl' ;
19 require "${General::swroot}/lang.pl" ;
20 require "${General::swroot}/header.pl" ;
24 my %filtersettings =();
25 my %updaccsettings =();
26 my %stdproxysettings =();
28 my $urlfilter_addon = 0 ;
29 my $updacclrtr_addon = 0 ;
34 my @throttle_limits =( 64 , 128 , 256 , 384 , 512 , 1024 , 2048 , 3072 , 5120 );
35 my $throttle_binary = "bin|cab|exe|gz|rar|sea|tar|tgz|zip" ;
36 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi" ;
37 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|qt|ra?m" ;
42 my $hintcolour = '#FFFFCC' ;
43 my $ncsa_buttontext = '' ;
58 my $replybodymaxsize = 0 ;
59 my $browser_regexp = '' ;
63 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
64 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
65 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
66 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
67 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
68 my $credir = "${General::swroot}/proxy/advanced/cre" ;
70 my $userdb = " $ncsadir /passwd" ;
71 my $stdgrp = " $ncsadir /standard.grp" ;
72 my $extgrp = " $ncsadir /extended.grp" ;
73 my $disgrp = " $ncsadir /disabled.grp" ;
75 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
76 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
77 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
79 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
80 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
81 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
83 my $identhosts = " $identdir /hosts" ;
85 my $libexecdir = "/usr/lib/squid" ;
87 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
88 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
89 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
90 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
91 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
92 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
93 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
94 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
95 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
96 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
97 my $acl_include = " $acldir /include.acl" ;
99 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
100 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
101 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
102 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
103 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
104 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
106 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
107 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
109 unless (- e
$userdb ) { system ( "touch $userdb " ); }
110 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
111 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
112 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
114 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
115 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
116 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
117 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
118 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
119 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
120 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
121 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
122 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
123 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
124 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
126 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
127 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
129 open FILE
, $browserdb ;
130 @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
>;
133 my %filtersettings =();
134 $filtersettings { 'CHILDREN' } = '5' ;
135 if (- e
"${General::swroot}/urlfilter/settings" ) {
136 & General
:: readhash
( "${General::swroot}/urlfilter/settings" , \
%filtersettings );
139 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
140 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
142 if (- e
"${General::swroot}/urlfilter/version" ) { $urlfilter_addon = 1 ; }
143 if (- e
"${General::swroot}/updacclrtr/version" ) { $updacclrtr_addon = 1 ; }
145 if ( $urlfilter_addon ) {
146 $filtersettings { 'CHILDREN' } = '5' ;
147 if (- e
"${General::swroot}/urlfilter/settings" ) {
148 & General
:: readhash
( "${General::swroot}/urlfilter/settings" , \
%filtersettings );
152 if ( $updacclrtr_addon ) {
153 $updaccsettings { 'ACCELERATORS' } = '10' ;
154 if (- e
"${General::swroot}/updacclrtr/settings" ) {
155 & General
:: readhash
( "${General::swroot}/updacclrtr/settings" , \
%updaccsettings );
159 & Header
:: showhttpheaders
();
161 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
162 $proxysettings { 'ACTION' } = '' ;
163 $proxysettings { 'VALID' } = '' ;
165 $proxysettings { 'ENABLE' } = 'off' ;
166 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
167 $proxysettings { 'TRANSPARENT' } = 'off' ;
168 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
169 $proxysettings { 'PROXY_PORT' } = '800' ;
170 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
171 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
172 $proxysettings { 'ERR_LANGUAGE' } = 'English' ;
173 $proxysettings { 'FORWARD_VIA' } = 'off' ;
174 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
175 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
176 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
177 $proxysettings { 'UPSTREAM_USER' } = '' ;
178 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
179 $proxysettings { 'LOGGING' } = 'off' ;
180 $proxysettings { 'LOGQUERY' } = 'off' ;
181 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
182 $proxysettings { 'CACHE_MEM' } = '2' ;
183 $proxysettings { 'CACHE_SIZE' } = '50' ;
184 $proxysettings { 'MAX_SIZE' } = '4096' ;
185 $proxysettings { 'MIN_SIZE' } = '0' ;
186 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
187 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
188 $proxysettings { 'L1_DIRS' } = '16' ;
189 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
190 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
191 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
192 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
193 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
194 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
195 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
196 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
197 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
198 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
199 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
200 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
201 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
202 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
203 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
204 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
205 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
206 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
207 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
208 $proxysettings { 'FAKE_USERAGENT' } = '' ;
209 $proxysettings { 'FAKE_REFERER' } = '' ;
210 $proxysettings { 'AUTH_METHOD' } = 'none' ;
211 $proxysettings { 'AUTH_REALM' } = '' ;
212 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
213 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
214 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
215 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
216 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
217 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
218 $proxysettings { 'NCSA_USERNAME' } = '' ;
219 $proxysettings { 'NCSA_GROUP' } = '' ;
220 $proxysettings { 'NCSA_PASS' } = '' ;
221 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
222 $proxysettings { 'LDAP_BASEDN' } = '' ;
223 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
224 $proxysettings { 'LDAP_SERVER' } = '' ;
225 $proxysettings { 'LDAP_PORT' } = '389' ;
226 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
227 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
228 $proxysettings { 'LDAP_GROUP' } = '' ;
229 $proxysettings { 'NTLM_DOMAIN' } = '' ;
230 $proxysettings { 'NTLM_PDC' } = '' ;
231 $proxysettings { 'NTLM_BDC' } = '' ;
232 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
233 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
234 $proxysettings { 'RADIUS_SERVER' } = '' ;
235 $proxysettings { 'RADIUS_PORT' } = '1645' ;
236 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
237 $proxysettings { 'RADIUS_SECRET' } = '' ;
238 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
239 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
240 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
241 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
242 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
243 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
245 if ( $urlfilter_addon ) {
246 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
249 if ( $updacclrtr_addon ) {
250 $proxysettings { 'ENABLE_UPDACCEL' } = 'off' ;
253 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
255 & Header
:: getcgihash
( \
%proxysettings );
257 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
258 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
259 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
260 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
262 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
264 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
267 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
269 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
270 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
271 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
273 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
274 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
276 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
277 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
279 if (! $errormessage ) {
280 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
281 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
283 $proxysettings { 'NCSA_USERNAME' } = '' ;
284 $proxysettings { 'NCSA_GROUP' } = '' ;
285 $proxysettings { 'NCSA_PASS' } = '' ;
286 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
289 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
291 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
292 & deluser
( $proxysettings { 'ID' });
295 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
297 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
298 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
299 @temp = split ( /:/ , $proxysettings { 'ID' });
300 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
301 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
302 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
303 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
306 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }))
308 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
309 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
310 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
311 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
312 $errormessage = $Lang :: tr
{ 'invalid input' };
315 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
316 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
318 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
321 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
322 ( $proxysettings { 'CACHE_MEM' } < 1 ))
324 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
327 my @free = `/usr/bin/free` ;
328 $free [ 1 ] =~ m/(\d+)/ ;
329 $cachemem = int $1 / 2048 ;
330 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
331 $proxysettings { 'CACHE_MEM' } = $cachemem ;
333 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
335 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
338 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
340 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
343 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
345 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
348 if ( $proxysettings { 'ENABLE_FILTER' } eq 'on' )
351 redirect_program /usr/bin/squidGuard
352 redirect_children $filtersettings {'CHILDREN'}
357 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
359 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
362 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
364 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
367 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
369 $browser_regexp = '' ;
370 foreach ( @useragentlist )
373 @useragent = split ( /,/ );
374 if ( $proxysettings { 'UA_' . @useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " @useragent [2]|" ; }
376 chop ( $browser_regexp );
377 if (! $browser_regexp )
379 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
383 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
385 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
386 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
387 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
389 if ( $netsettings { 'BLUE_DEV' })
391 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
392 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
394 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
398 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
400 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
405 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
406 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
408 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
411 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
413 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
416 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
418 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
421 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
423 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
426 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
428 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
432 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
434 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
436 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
440 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
442 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
444 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
448 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
450 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
452 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
455 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
457 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
460 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
462 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
465 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
467 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
469 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
474 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
476 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
478 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
481 if ( $proxysettings { 'NTLM_PDC' } eq '' )
483 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
486 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
488 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
491 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
493 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
497 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
499 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
501 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
504 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
506 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
509 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
511 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
516 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
519 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
520 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
521 if (( $proxy1 ne $proxy2 ))
523 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
531 $proxysettings { 'VALID' } = 'no' ; }
533 $proxysettings { 'VALID' } = 'yes' ; }
535 if ( $proxysettings { 'VALID' } eq 'yes' )
539 delete $proxysettings { 'SRC_SUBNETS' };
540 delete $proxysettings { 'SRC_BANNED_IP' };
541 delete $proxysettings { 'SRC_BANNED_MAC' };
542 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
543 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
544 delete $proxysettings { 'DST_NOCACHE' };
545 delete $proxysettings { 'DST_NOAUTH' };
546 delete $proxysettings { 'MIME_TYPES' };
547 delete $proxysettings { 'NTLM_ALLOW_USERS' };
548 delete $proxysettings { 'NTLM_DENY_USERS' };
549 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
550 delete $proxysettings { 'RADIUS_DENY_USERS' };
551 delete $proxysettings { 'IDENT_HOSTS' };
552 delete $proxysettings { 'IDENT_ALLOW_USERS' };
553 delete $proxysettings { 'IDENT_DENY_USERS' };
555 delete $proxysettings { 'CRE_GROUPS' };
556 delete $proxysettings { 'CRE_SVHOSTS' };
558 delete $proxysettings { 'NCSA_USERNAME' };
559 delete $proxysettings { 'NCSA_GROUP' };
560 delete $proxysettings { 'NCSA_PASS' };
561 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
563 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
564 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
565 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
566 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
567 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
568 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
569 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
571 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
572 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
574 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
576 if ( $urlfilter_addon )
578 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
579 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
580 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
583 if ( $updacclrtr_addon )
585 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
586 $stdproxysettings { 'ENABLE_UPDACCEL' } = $proxysettings { 'ENABLE_UPDACCEL' };
587 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
593 unlink "${General::swroot}/proxy/enable" ;
594 unlink "${General::swroot}/proxy/transparent" ;
595 unlink "${General::swroot}/proxy/enable_blue" ;
596 unlink "${General::swroot}/proxy/transparent_blue" ;
598 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
599 system ( '/bin/touch' , "${General::swroot}/proxy/enable" ); }
600 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) {
601 system ( '/bin/touch' , "${General::swroot}/proxy/transparent" ); }
602 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
603 system ( '/bin/touch' , "${General::swroot}/proxy/enable_blue" ); }
604 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) {
605 system ( '/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
607 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/restartsquid' ); }
611 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'clear cache' })
613 system ( '/usr/local/bin/restartsquid' , '-f' );
618 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
619 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
620 } elsif (- e
"${General::swroot}/proxy/settings" ) {
621 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
626 $checked { 'ENABLE' }{ 'off' } = '' ;
627 $checked { 'ENABLE' }{ 'on' } = '' ;
628 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
630 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
631 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
632 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
634 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
635 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
636 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
638 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
639 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
640 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
642 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
643 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
644 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
645 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
646 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
647 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
648 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
649 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
650 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
652 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
653 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
654 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
655 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
656 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
657 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
659 $checked { 'LOGGING' }{ 'off' } = '' ;
660 $checked { 'LOGGING' }{ 'on' } = '' ;
661 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
662 $checked { 'LOGQUERY' }{ 'off' } = '' ;
663 $checked { 'LOGQUERY' }{ 'on' } = '' ;
664 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
665 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
666 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
667 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
669 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
671 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
672 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
673 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
675 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
676 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
677 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
678 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
679 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
681 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
682 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
683 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
684 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
685 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
686 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
687 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
689 $checked { 'TIME_MON' }{ 'off' } = '' ;
690 $checked { 'TIME_MON' }{ 'on' } = '' ;
691 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
692 $checked { 'TIME_TUE' }{ 'off' } = '' ;
693 $checked { 'TIME_TUE' }{ 'on' } = '' ;
694 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
695 $checked { 'TIME_WED' }{ 'off' } = '' ;
696 $checked { 'TIME_WED' }{ 'on' } = '' ;
697 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
698 $checked { 'TIME_THU' }{ 'off' } = '' ;
699 $checked { 'TIME_THU' }{ 'on' } = '' ;
700 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
701 $checked { 'TIME_FRI' }{ 'off' } = '' ;
702 $checked { 'TIME_FRI' }{ 'on' } = '' ;
703 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
704 $checked { 'TIME_SAT' }{ 'off' } = '' ;
705 $checked { 'TIME_SAT' }{ 'on' } = '' ;
706 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
707 $checked { 'TIME_SUN' }{ 'off' } = '' ;
708 $checked { 'TIME_SUN' }{ 'on' } = '' ;
709 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
711 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
712 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
713 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
714 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
716 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
717 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
718 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
719 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
720 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
721 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
722 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
723 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
724 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
726 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
727 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
728 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
730 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
731 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
732 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
734 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
735 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
736 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
738 foreach ( @useragentlist ) {
739 @useragent = split ( /,/ );
740 $checked { 'UA_' . @useragent [ 0 ]}{ 'off' } = '' ;
741 $checked { 'UA_' . @useragent [ 0 ]}{ 'on' } = '' ;
742 $checked { 'UA_' . @useragent [ 0 ]}{ $proxysettings { 'UA_' . @useragent [ 0 ]}} = "checked='checked'" ;
745 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
746 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
747 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
748 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
749 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
750 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
751 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
753 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
755 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
756 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
757 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
759 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
760 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
761 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
763 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
765 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
767 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
769 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
770 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
771 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
773 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
774 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
775 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
777 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
778 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
779 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
781 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
782 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
783 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
785 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
786 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
787 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
789 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
790 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
791 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
793 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
794 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
795 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
797 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
798 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
799 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
801 if ( $urlfilter_addon ) {
802 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
803 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
804 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
807 if ( $updacclrtr_addon ) {
808 $checked { 'ENABLE_UPDACCEL' }{ 'off' } = '' ;
809 $checked { 'ENABLE_UPDACCEL' }{ 'on' } = '' ;
810 $checked { 'ENABLE_UPDACCEL' }{ $proxysettings { 'ENABLE_UPDACCEL' }} = "checked='checked'" ;
813 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
815 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
818 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
819 print "<font class='base'> $errormessage </font> \n " ;
823 # ===================================================================
825 # ===================================================================
827 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
829 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
831 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
836 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
839 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
840 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
841 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
842 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
845 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
846 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
847 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
848 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
853 if ( $netsettings { 'BLUE_DEV' }) {
854 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
855 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
857 print "<td colspan='2'> </td>" ;
860 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
861 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
866 if ( $netsettings { 'BLUE_DEV' }) {
867 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
868 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
870 print "<td colspan='2'> </td>" ;
873 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
875 <select name='ERR_LANGUAGE'>
878 foreach (< /usr/li b
/squid/ errors
/*>) {
880 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
881 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
889 <td colspan='4'><hr /><b> $Lang ::tr{'urlfilter url filter'}</b></td>
892 <td width='25%' class='base'> $Lang ::tr{'urlfilter enabled'}</td>
893 <td><input type='checkbox' name='ENABLE_FILTER' $checked {'ENABLE_FILTER'}{'on'} /></td>
894 <td colspan='2'> </td>
900 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
903 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}</font>:</td>
904 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
905 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'} <img src='/blob.gif' alt='*' /></td>
906 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
909 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}</font>:</td>
910 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
911 <td class='base'> $Lang ::tr{'advproxy upstream username'}: <img src='/blob.gif' alt='*' /></td>
912 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
915 <td class='base'> $Lang ::tr{'advproxy username forwarding'}</font>:</td>
916 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
917 <td class='base'> $Lang ::tr{'advproxy upstream password'}: <img src='/blob.gif' alt='*' /></td>
918 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
924 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
927 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
928 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
929 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
930 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
935 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
936 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
942 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
945 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
948 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
949 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
950 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
951 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
954 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
955 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
956 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
957 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
960 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
961 <td class='base'><select name='L1_DIRS'>
962 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
963 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
964 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
965 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
966 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
968 <td colspan='2' rowspan= '5' valign='top' class='base'>
969 <table cellpadding='0' cellspacing='0'>
971 <!-- intentionally left empty -->
974 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
977 <!-- intentionally left empty -->
980 <!-- intentionally left empty -->
983 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
987 print $proxysettings { 'DST_NOCACHE' };
996 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
997 <td class='base'><select name='MEM_POLICY'>
998 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
999 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1000 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1001 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1005 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1006 <td class='base'><select name='CACHE_POLICY'>
1007 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1008 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1009 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1010 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1014 <td colspan='2'> </td>
1017 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1018 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1022 <table width='100%'>
1024 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1027 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1030 <td colspan='2' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1031 <td colspan='2'> </td>
1034 <td colspan='2'><textarea name='SRC_SUBNETS' cols='32' rows='6' wrap='off'>
1038 if (! $proxysettings { 'SRC_SUBNETS' }) {
1039 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1040 if ( $netsettings { 'BLUE_DEV' }) {
1041 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1044 print $proxysettings { 'SRC_SUBNETS' };
1049 <td colspan='2'> </td>
1052 <table width='100%'>
1054 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1057 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1058 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1061 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='6' wrap='off'>
1065 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1069 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='6' wrap='off'>
1073 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1079 <table width='100%'>
1081 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1084 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1085 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1088 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='6' wrap='off'>
1092 print $proxysettings { 'SRC_BANNED_IP' };
1096 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='6' wrap='off'>
1100 print $proxysettings { 'SRC_BANNED_MAC' };
1111 # -------------------------------------------------------------------
1112 # CRE GUI - optional
1113 # -------------------------------------------------------------------
1115 if (- e
$cre_enabled ) { print <<END
1116 <table width='100%'>
1119 <td colspan='4'><b> $Lang ::tr{'advproxy classroom extensions'}</b></td>
1122 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1125 <td class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1126 <td><input type='checkbox' name='CLASSROOM_EXT' $checked {'CLASSROOM_EXT'}{'on'} /></td>
1127 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1128 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1131 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1132 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1135 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1139 print $proxysettings { 'CRE_GROUPS' };
1143 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1146 print $proxysettings { 'CRE_SVHOSTS' };
1159 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1160 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1161 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1165 # -------------------------------------------------------------------
1169 <table width='100%'>
1171 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1173 <table width='100%'>
1175 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1176 <td width='1%'> </td>
1177 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1178 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1179 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1180 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1181 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1182 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1183 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1184 <td width='1%'> </td>
1185 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1186 <td width='1%'> </td>
1187 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1192 <select name='TIME_ACCESS_MODE'>
1193 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1194 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1198 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1199 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1200 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1201 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1202 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1203 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1204 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1207 <select name='TIME_FROM_HOUR'>
1210 for ( $i = 0 ; $i <= 24 ; $i ++) {
1211 $_ = sprintf ( " %02s " , $i );
1212 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1219 <select name='TIME_FROM_MINUTE'>
1222 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1223 $_ = sprintf ( " %02s " , $i );
1224 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1231 <select name='TIME_TO_HOUR'>
1234 for ( $i = 0 ; $i <= 24 ; $i ++) {
1235 $_ = sprintf ( " %02s " , $i );
1236 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1243 <select name='TIME_TO_MINUTE'>
1246 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1247 $_ = sprintf ( " %02s " , $i );
1248 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1256 <table width='100%'>
1258 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1261 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1262 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1263 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1264 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1268 <table width='100%'>
1270 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1273 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1274 <td width='20%' class='base'>
1275 <select name='THROTTLING_GREEN_TOTAL'>
1279 foreach ( @throttle_limits ) {
1280 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1284 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1287 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1288 <td width='30%' class='base'>
1289 <select name='THROTTLING_GREEN_HOST'>
1293 foreach ( @throttle_limits ) {
1294 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1298 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1305 if ( $netsettings { 'BLUE_DEV' }) {
1308 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1310 <select name='THROTTLING_BLUE_TOTAL'>
1314 foreach ( @throttle_limits ) {
1315 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1319 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1322 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1324 <select name='THROTTLING_BLUE_HOST'>
1328 foreach ( @throttle_limits ) {
1329 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1333 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1343 <table width='100%'>
1345 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1348 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1349 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1350 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1351 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1352 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1353 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1354 <td width='15%'> </td>
1355 <td width='10%'> </td>
1359 <table width='100%'>
1361 <td colspan='4'><b> $Lang ::tr{'advproxy MIME filter'}</b></td>
1364 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1365 <td width='20%'><input type='checkbox' name='ENABLE_MIME_FILTER' $checked {'ENABLE_MIME_FILTER'}{'on'} /></td>
1368 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1373 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1377 print $proxysettings { 'MIME_TYPES' };
1386 <table width='100%'>
1388 <td colspan='4'><b> $Lang ::tr{'advproxy web browser'}</b></td>
1391 <td width='25%' class='base'> $Lang ::tr{'advproxy UA enable filter'}:</td>
1392 <td width='20%'><input type='checkbox' name='ENABLE_BROWSER_CHECK' $checked {'ENABLE_BROWSER_CHECK'}{'on'} /></td>
1400 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1405 <table width='100%'>
1409 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1410 for ( $i = 0 ; $i <= 3 ; $i ++) {
1411 if ( $i eq 0 ) { print "<tr> \n " ; }
1412 if (( $n + $i ) < @useragentlist ) {
1413 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1414 print "<td width='15%'> @useragent [1]:<\/td> \n " ;
1415 print "<td width='10%'><input type='checkbox' name='UA_ @useragent [0]' $checked {'UA_'. @useragent [0]}{'on'} /></td> \n " ;
1417 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1424 <table width='100%'>
1426 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1429 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1432 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='56' /></td>
1435 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1438 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='56' /></td>
1445 if ( $urlfilter_addon ) {
1447 <table width='100%'>
1449 <td colspan='4'><b> $Lang ::tr{'advproxy url filter'}</b></td>
1452 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1453 <td><input type='checkbox' name='ENABLE_FILTER' $checked {'ENABLE_FILTER'}{'on'} /></td>
1462 if (( $updacclrtr_addon ) && (!( $urlfilter_addon ))) {
1464 <table width='100%'>
1466 <td colspan='4'><b> $Lang ::tr{'advproxy update accelerator'}</b></td>
1469 <td class='base' width='25%'> $Lang ::tr{'advproxy enabled'}:</td>
1470 <td><input type='checkbox' name='ENABLE_UPDACCEL' $checked {'ENABLE_UPDACCEL'}{'on'} /></td>
1480 <table width='100%'>
1482 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1485 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1486 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1487 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1488 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1489 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1490 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1496 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1498 <table width='100%'>
1500 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1503 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1506 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1507 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1508 <td colspan='2' rowspan= '6' valign='top' class='base'>
1509 <table cellpadding='0' cellspacing='0'>
1511 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1514 <!-- intentionally left empty -->
1517 <!-- intentionally left empty -->
1520 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1523 <!-- intentionally left empty -->
1526 <!-- intentionally left empty -->
1529 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1532 <!-- intentionally left empty -->
1535 <!-- intentionally left empty -->
1538 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1542 print $proxysettings { 'DST_NOAUTH' };
1551 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1552 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1555 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1556 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1559 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1560 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1563 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1564 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1567 <td colspan='2'> </td>
1574 # ===================================================================
1575 # NCSA auth settings
1576 # ===================================================================
1578 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1581 <table width='100%'>
1583 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1586 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1587 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1588 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1589 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1592 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1600 # ===================================================================
1601 # IDENTD auth settings
1602 # ===================================================================
1604 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1607 <table width='100%'>
1609 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1612 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1613 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1614 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1615 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1618 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1619 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1624 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1625 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1628 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1631 if (! $proxysettings { 'IDENT_HOSTS' }) {
1632 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1633 if ( $netsettings { 'BLUE_DEV' }) {
1634 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1637 print $proxysettings { 'IDENT_HOSTS' };
1642 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1646 print $proxysettings { 'DST_NOAUTH' };
1653 <table width='100%'>
1655 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1658 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1659 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1660 <td width='25%'> </td>
1661 <td width='30%'> </td>
1664 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1665 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1666 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1667 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1670 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1671 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1674 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1678 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1680 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1682 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1686 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1688 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1695 # ===================================================================
1696 # NTLM auth settings
1697 # ===================================================================
1699 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1702 <table width='100%'>
1704 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1707 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1708 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1709 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1710 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1711 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1712 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1716 <table width='100%'>
1718 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1721 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1722 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1727 <table width='100%'>
1729 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1732 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1733 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1734 <td width='25%'> </td>
1735 <td width='30%'> </td>
1738 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1739 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1740 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1741 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1744 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1745 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1748 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1752 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1754 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1756 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1760 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1762 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1769 # ===================================================================
1770 # LDAP auth settings
1771 # ===================================================================
1773 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1776 <table width='100%'>
1778 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1781 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1782 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1783 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1784 <td class='base'><select name='LDAP_TYPE'>
1785 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1786 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1787 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1788 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1792 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1793 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1794 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1795 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1799 <table width='100%'>
1801 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1804 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1805 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1806 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1807 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1811 <table width='100%'>
1813 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1816 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
1817 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1825 # ===================================================================
1826 # RADIUS auth settings
1827 # ===================================================================
1829 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1832 <table width='100%'>
1834 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1837 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1838 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1839 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1840 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1843 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
1844 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1845 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1846 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1850 <table width='100%'>
1852 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1855 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1856 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1857 <td width='25%'> </td>
1858 <td width='30%'> </td>
1861 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1862 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1863 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1864 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1867 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1868 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1871 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1875 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
1877 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1879 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
1883 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
1885 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1892 # ===================================================================
1898 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
1900 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1901 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1902 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1903 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1904 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
1905 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1906 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
1910 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1912 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1913 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1914 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1915 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1916 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1920 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
1922 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
1923 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
1927 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
1929 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
1930 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
1931 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
1932 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
1933 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
1934 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
1935 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
1939 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
1941 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
1942 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
1943 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
1944 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
1945 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
1946 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
1947 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
1951 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
1953 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
1954 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
1955 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
1956 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
1957 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
1958 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
1959 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
1960 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
1964 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
1966 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
1967 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
1968 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
1969 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
1970 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
1971 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
1972 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
1973 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
1985 <table width='100%'>
1988 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
1989 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
1990 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'clear cache'}' /></td>
1996 <table width='100%'>
1998 <td><img src='/blob.gif' align='top' alt='*' />
1999 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2010 & Header
:: closebox
();
2014 # ===================================================================
2015 # NCSA user management
2016 # ===================================================================
2018 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2020 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2021 <table width='100%'>
2023 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2026 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2027 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2030 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly " ; }
2033 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2035 <select name='NCSA_GROUP'>
2036 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2037 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2038 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2044 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2045 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2046 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2047 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2054 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2055 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2056 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2059 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2060 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2066 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2071 <table width='100%'>
2073 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2076 <table width='100%' align='center'>
2082 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2083 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2087 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2088 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2092 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2093 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2096 @userlist = sort ( @userlist );
2098 # If the password file contains entries, print entries and action icons
2100 if (! - z
" $userdb " ) {
2103 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2104 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2105 <td class='boldbase' colspan='2' align='center'> </td>
2110 foreach $line ( @userlist )
2114 @temp = split ( /:/ , $line );
2115 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2116 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2118 print "<tr bgcolor=' $Header ::table1colour'> \n " ; }
2120 print "<tr bgcolor=' $Header ::table2colour'> \n " ; }
2123 <td align='center'> $temp [0]</td>
2127 if ( $temp [ 1 ] eq 'standard' ) {
2128 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2129 } elsif ( $temp [ 1 ] eq 'extended' ) {
2130 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2131 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2132 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2135 <td width='8%' align='center'>
2136 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2137 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2138 <input type='hidden' name='ID' value=' $line ' />
2139 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2143 <td width='8%' align='center'>
2144 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2145 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2146 <input type='hidden' name='ID' value=' $temp [0]' />
2147 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2158 <table witdh='100%'>
2160 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2161 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2162 <td class='base'> $Lang ::tr{'edit'}</td>
2163 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2164 <td class='base'> $Lang ::tr{'remove'}</td>
2171 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2182 & Header
:: closebox
();
2186 # ===================================================================
2188 & Header
:: closebigbox
();
2190 & Header
:: closepage
();
2192 # -------------------------------------------------------------------
2196 if (- e
" $acl_src_subnets " ) {
2197 open ( FILE
, " $acl_src_subnets " );
2198 delete $proxysettings { 'SRC_SUBNETS' };
2199 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2202 if (- e
" $acl_src_banned_ip " ) {
2203 open ( FILE
, " $acl_src_banned_ip " );
2204 delete $proxysettings { 'SRC_BANNED_IP' };
2205 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2208 if (- e
" $acl_src_banned_mac " ) {
2209 open ( FILE
, " $acl_src_banned_mac " );
2210 delete $proxysettings { 'SRC_BANNED_MAC' };
2211 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2214 if (- e
" $acl_src_unrestricted_ip " ) {
2215 open ( FILE
, " $acl_src_unrestricted_ip " );
2216 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2217 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2220 if (- e
" $acl_src_unrestricted_mac " ) {
2221 open ( FILE
, " $acl_src_unrestricted_mac " );
2222 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2223 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2226 if (- e
" $acl_dst_nocache " ) {
2227 open ( FILE
, " $acl_dst_nocache " );
2228 delete $proxysettings { 'DST_NOCACHE' };
2229 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2232 if (- e
" $acl_dst_noauth " ) {
2233 open ( FILE
, " $acl_dst_noauth " );
2234 delete $proxysettings { 'DST_NOAUTH' };
2235 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2238 if (- e
" $mimetypes " ) {
2239 open ( FILE
, " $mimetypes " );
2240 delete $proxysettings { 'MIME_TYPES' };
2241 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2244 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2245 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2246 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2247 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2250 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2251 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2252 delete $proxysettings { 'NTLM_DENY_USERS' };
2253 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2256 if (- e
" $raddir /radauth.allowusers" ) {
2257 open ( FILE
, " $raddir /radauth.allowusers" );
2258 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2259 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2262 if (- e
" $raddir /radauth.denyusers" ) {
2263 open ( FILE
, " $raddir /radauth.denyusers" );
2264 delete $proxysettings { 'RADIUS_DENY_USERS' };
2265 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2268 if (- e
" $identdir /identauth.allowusers" ) {
2269 open ( FILE
, " $identdir /identauth.allowusers" );
2270 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2271 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2274 if (- e
" $identdir /identauth.denyusers" ) {
2275 open ( FILE
, " $identdir /identauth.denyusers" );
2276 delete $proxysettings { 'IDENT_DENY_USERS' };
2277 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2280 if (- e
" $identhosts " ) {
2281 open ( FILE
, " $identhosts " );
2282 delete $proxysettings { 'IDENT_HOSTS' };
2283 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2286 if (- e
" $cre_groups " ) {
2287 open ( FILE
, " $cre_groups " );
2288 delete $proxysettings { 'CRE_GROUPS' };
2289 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2292 if (- e
" $cre_svhosts " ) {
2293 open ( FILE
, " $cre_svhosts " );
2294 delete $proxysettings { 'CRE_SVHOSTS' };
2295 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2300 # -------------------------------------------------------------------
2304 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2305 undef $proxysettings { 'SRC_SUBNETS' };
2308 s/^\s+//g ; s/\s+$//g ;
2311 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2312 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2316 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2317 undef $proxysettings { 'SRC_BANNED_IP' };
2320 s/^\s+//g ; s/\s+$//g ;
2323 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2324 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2328 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2329 undef $proxysettings { 'SRC_BANNED_MAC' };
2332 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2335 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2336 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2340 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2341 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2344 s/^\s+//g ; s/\s+$//g ;
2347 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2348 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2352 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2353 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2356 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2359 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2360 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2364 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2366 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2367 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2370 s/^\s+//g ; s/\s+$//g ;
2371 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2373 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2376 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2378 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2379 undef $proxysettings { 'NTLM_DENY_USERS' };
2382 s/^\s+//g ; s/\s+$//g ;
2383 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2385 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2388 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2390 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2391 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2394 s/^\s+//g ; s/\s+$//g ;
2395 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2397 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2400 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2402 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2403 undef $proxysettings { 'IDENT_DENY_USERS' };
2406 s/^\s+//g ; s/\s+$//g ;
2407 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2409 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2412 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2414 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2415 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2418 s/^\s+//g ; s/\s+$//g ;
2419 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2421 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2424 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2426 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2427 undef $proxysettings { 'RADIUS_DENY_USERS' };
2430 s/^\s+//g ; s/\s+$//g ;
2431 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2433 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2436 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2437 undef $proxysettings { 'IDENT_HOSTS' };
2440 s/^\s+//g ; s/\s+$//g ;
2443 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2444 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2448 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2449 undef $proxysettings { 'CRE_SVHOSTS' };
2452 s/^\s+//g ; s/\s+$//g ;
2455 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2456 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2462 # -------------------------------------------------------------------
2466 open ( FILE
, "> $acl_src_subnets " );
2468 print FILE
$proxysettings { 'SRC_SUBNETS' };
2471 open ( FILE
, "> $acl_src_banned_ip " );
2473 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2476 open ( FILE
, "> $acl_src_banned_mac " );
2478 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2481 open ( FILE
, "> $acl_src_unrestricted_ip " );
2483 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2486 open ( FILE
, "> $acl_src_unrestricted_mac " );
2488 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2491 open ( FILE
, "> $acl_dst_nocache " );
2493 print FILE
$proxysettings { 'DST_NOCACHE' };
2496 open ( FILE
, "> $acl_dst_noauth " );
2498 print FILE
$proxysettings { 'DST_NOAUTH' };
2501 open ( FILE
, "> $acl_dst_throttle " );
2503 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2505 @temp = split ( /\|/ , $throttle_binary );
2506 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2508 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2510 @temp = split ( /\|/ , $throttle_dskimg );
2511 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2513 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2515 @temp = split ( /\|/ , $throttle_mmedia );
2516 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2518 if (- s
$throttled_urls )
2520 open ( URLFILE
, $throttled_urls );
2523 foreach ( @temp ) { print FILE
; }
2527 open ( FILE
, "> $mimetypes " );
2529 print FILE
$proxysettings { 'MIME_TYPES' };
2532 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2534 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2537 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2539 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2542 open ( FILE
, "> $raddir /radauth.allowusers" );
2544 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2547 open ( FILE
, "> $raddir /radauth.denyusers" );
2549 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2552 open ( FILE
, "> $identdir /identauth.allowusers" );
2554 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2557 open ( FILE
, "> $identdir /identauth.denyusers" );
2559 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2562 open ( FILE
, "> $identhosts " );
2564 print FILE
$proxysettings { 'IDENT_HOSTS' };
2567 open ( FILE
, "> $cre_groups " );
2569 print FILE
$proxysettings { 'CRE_GROUPS' };
2572 open ( FILE
, "> $cre_svhosts " );
2574 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2578 # -------------------------------------------------------------------
2582 open ( FILE
, ">/home/httpd/html/proxy.pac" );
2584 print FILE
"function FindProxyForURL(url, host) \n " ;
2586 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2590 (isPlainHostName(host)) ||
2591 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2592 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2593 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2594 (isInNet(host, "169.254.0.0", "255.255.0.0")) ||
2595 (isInNet(host, "192.168.0.0", "255.255.0.0"))
2603 if ( $proxysettings { 'ENABLE' } eq 'on' )
2607 (isInNet(myIpAddress(), " $netsettings {'GREEN_NETADDRESS'}", " $netsettings {'GREEN_NETMASK'}"))
2609 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2613 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2615 print FILE
" \n else \n\n " ;
2617 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2621 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2623 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2632 # -------------------------------------------------------------------
2639 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2640 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2641 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2642 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2644 $delaypools = 1 ; } else { $delaypools = 0 ;
2647 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2649 $authrealm = "IPFire Advanced Proxy Server" ;
2651 $authrealm = $proxysettings { 'AUTH_REALM' };
2654 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2655 my ( $remotehost , $remoteport ) = ( /^(?:[a-zA-Z ]+\:\/ \
/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/ .* ?
) ?
$/);
2657 if ( $remoteport eq '' ) { $remoteport = 80 ; }
2659 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
2662 shutdown_lifetime 5 seconds
2665 http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}
2668 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
2669 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'} \n " ;
2674 acl QUERY urlpath_regex cgi-bin \\ ?
2678 if (!- z
$acl_dst_nocache ) {
2679 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache \"\n " ;
2680 print FILE
"no_cache deny no_cache_domains \n " ;
2685 cache_effective_user squid
2686 cache_effective_group squid
2688 pid_filename /var/run/squid.pid
2690 cache_mem $proxysettings {'CACHE_MEM'} MB
2691 cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256
2693 error_directory /usr/lib/squid/errors/ $proxysettings {'ERR_LANGUAGE'}
2698 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
2700 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
2702 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
2704 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
2706 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
2708 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
2713 if ( $proxysettings { 'LOGGING' } eq 'on' )
2716 cache_access_log /var/log/squid/access.log
2717 cache_log /var/log/squid/cache.log
2718 cache_store_log none
2721 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"useragent_log \/var\/log\/squid\/user_agent.log \n " ; }
2722 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
2725 cache_access_log /dev/null
2727 cache_store_log none
2736 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
2738 print FILE
"forwarded_for on \n\n " ;
2740 print FILE
"forwarded_for off \n\n " ;
2743 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
2745 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
2747 print FILE
"auth_param basic program $libexecdir /ncsa_auth $userdb \n " ;
2748 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2749 print FILE
"auth_param basic realm $authrealm \n " ;
2750 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2751 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2754 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
2756 print FILE
"auth_param basic program $libexecdir /squid_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
2757 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
2758 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
2759 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
2761 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2763 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
2765 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2767 print FILE
" -u sAMAccountName -P" ;
2769 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
2771 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2773 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
2775 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
2777 print FILE
" -u cn -P" ;
2779 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
2781 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2783 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
2785 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2787 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
2788 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
2789 print FILE
" -u uid -P" ;
2791 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
2792 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2793 print FILE
"auth_param basic realm $authrealm \n " ;
2794 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2795 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2798 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
2800 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
2802 print FILE
"auth_param ntlm program $libexecdir /ntlm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
2803 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
2804 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
2805 print FILE
"auth_param ntlm max_challenge_reuses 0 \n " ;
2806 print FILE
"auth_param ntlm max_challenge_lifetime 2 minutes \n " ;
2807 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2809 print FILE
"auth_param basic program $libexecdir /msnt_auth \n " ;
2810 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2811 print FILE
"auth_param basic realm $authrealm \n " ;
2812 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2813 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2815 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
2817 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
2818 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
2819 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
2820 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
2822 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
2824 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
2826 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
2833 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
2835 print FILE
"auth_param basic program $libexecdir /squid_rad_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
2836 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
2837 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
2838 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2839 print FILE
"auth_param basic realm $authrealm \n " ;
2840 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2841 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2845 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
2846 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
2848 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2850 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
2852 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2854 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
2857 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
2859 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2861 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
2863 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2865 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
2868 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
2871 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
2872 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
2874 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
2877 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n\n " ; }
2880 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
2882 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
2884 print FILE
"acl for_inetusers ident REQUIRED \n " ;
2886 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
2888 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2890 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
2892 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2894 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
2899 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
2901 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
2903 print FILE
"acl within_timeframe time " ;
2904 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
2905 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
2906 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
2907 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
2908 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
2909 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
2910 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
2911 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
2912 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
2913 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
2914 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
2916 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
2917 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
2921 acl all src 0.0.0.0/0.0.0.0
2922 acl localhost src 127.0.0.1/255.255.255.255
2923 acl SSL_ports port 443 563
2924 acl Safe_ports port 80 # http
2925 acl Safe_ports port 21 # ftp
2926 acl Safe_ports port 443 563 # https, snews
2927 acl Safe_ports port 70 # gopher
2928 acl Safe_ports port 210 # wais
2929 acl Safe_ports port 1025-65535 # unregistered ports
2930 acl Safe_ports port 280 # http-mgmt
2931 acl Safe_ports port 488 # gss-http
2932 acl Safe_ports port 591 # filemaker
2933 acl Safe_ports port 777 # multiling http
2934 acl Safe_ports port 800 # Squids port (for icons)
2936 acl IPCop_http port 81
2937 acl IPCop_https port 445
2938 acl IPCop_ips dst $netsettings {'GREEN_ADDRESS'}
2939 acl IPCop_networks src " $acl_src_subnets "
2940 acl IPCop_green_network src $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
2943 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_network src $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
2944 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPCop_banned_ips src \" $acl_src_banned_ip \"\n " ; }
2945 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPCop_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
2946 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPCop_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
2947 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPCop_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
2949 acl CONNECT method CONNECT
2953 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
2956 #Classroom extensions
2957 acl IPCop_no_access_ips src " $acl_src_noaccess_ip "
2958 acl IPCop_no_access_mac arp " $acl_src_noaccess_mac "
2961 print FILE
"deny_info " ;
2962 if (- e
"/usr/lib/squid/errors/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ) {
2963 print FILE
"ERR_ACCESS_DISABLED" ;
2964 } else { print FILE
"ERR_ACCESS_DENIED" ; }
2965 print FILE
" IPCop_no_access_ips \n " ;
2966 print FILE
"deny_info " ;
2967 if (- e
"/usr/lib/squid/errors/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ) {
2968 print FILE
"ERR_ACCESS_DISABLED" ;
2969 } else { print FILE
"ERR_ACCESS_DENIED" ; }
2970 print FILE
" IPCop_no_access_mac \n " ;
2973 http_access deny IPCop_no_access_ips
2974 http_access deny IPCop_no_access_mac
2979 #Insert acl file and replace __VAR__ with correct values
2980 my $blue_net = '' ; #BLUE empty by default
2982 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
2983 $blue_net = " $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'}" ;
2984 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
2986 if (!- z
$acl_include )
2988 open ( ACL
, " $acl_include " );
2989 print FILE
" \n #Start of custom includes \n " ;
2991 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
2992 $_ =~ s/__GREEN_NET__/$netsettings{'GREEN_NETADDRESS'}\/ $netsettings { 'GREEN_NETMASK' }/;
2993 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
2994 $_ =~ s/__BLUE_NET__/$blue_net/ ;
2997 print FILE
"#End of custom includes \n " ;
3000 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3004 #local machine, no restriction
3005 http_access allow localhost
3007 #GUI admin if local machine connects
3008 http_access allow IPCop_ips IPCop_networks IPCop_http
3009 http_access allow CONNECT IPCop_ips IPCop_networks IPCop_https
3011 #Deny not web services
3012 http_access deny !Safe_ports
3013 http_access deny CONNECT !SSL_ports
3018 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3020 print FILE
"#Set ident ACLs \n " ;
3021 if (!- z
$identhosts )
3023 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3024 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3025 print FILE
"ident_lookup_access deny all \n " ;
3027 print FILE
"ident_lookup_access allow all \n " ;
3029 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3033 print FILE
"#Set download throttling \n " ;
3035 if ( $netsettings { 'BLUE_DEV' })
3037 print FILE
"delay_pools 2 \n " ;
3039 print FILE
"delay_pools 1 \n " ;
3042 print FILE
"delay_class 1 3 \n " ;
3043 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3045 print FILE
"delay_parameters 1 " ;
3046 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3050 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3052 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3055 print FILE
" -1/-1 " ;
3056 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3060 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3062 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3066 if ( $netsettings { 'BLUE_DEV' })
3068 print FILE
"delay_parameters 2 " ;
3069 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3073 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3075 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3077 print FILE
" -1/-1 " ;
3078 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3082 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3084 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3089 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPCop_unrestricted_ips \n " ; }
3090 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPCop_unrestricted_mac \n " ; }
3091 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3093 if ( $netsettings { 'BLUE_DEV' })
3095 print FILE
"delay_access 1 allow IPCop_green_network" ;
3096 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3098 print FILE
"delay_access 1 deny all \n " ;
3100 print FILE
"delay_access 1 allow all" ;
3101 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3105 if ( $netsettings { 'BLUE_DEV' })
3107 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPCop_unrestricted_ips \n " ; }
3108 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPCop_unrestricted_mac \n " ; }
3109 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3110 print FILE
"delay_access 2 allow IPCop_blue_network" ;
3111 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3113 print FILE
"delay_access 2 deny all \n " ;
3116 print FILE
"delay_initial_bucket_level 100% \n " ;
3120 #Set custom configured ACLs
3123 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPCop_banned_ips \n " ; }
3124 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPCop_banned_mac \n " ; }
3126 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3128 if (!- z
$acl_src_unrestricted_ip )
3130 print FILE
"http_access allow IPCop_unrestricted_ips to_domains_without_auth \n " ;
3132 if (!- z
$acl_src_unrestricted_mac )
3134 print FILE
"http_access allow IPCop_unrestricted_mac to_domains_without_auth \n " ;
3136 print FILE
"http_access allow IPCop_networks" ;
3137 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3138 print FILE
" !within_timeframe" ;
3140 print FILE
" within_timeframe" ; }
3141 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3142 print FILE
" to_domains_without_auth \n " ;
3145 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3147 print FILE
"http_access deny !for_inetusers" ;
3148 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3153 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3154 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3155 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3156 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3157 (!- z
" $identdir /identauth.denyusers" )
3160 print FILE
"http_access deny for_acl_users" ;
3161 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3165 if (!- z
$acl_src_unrestricted_ip )
3167 print FILE
"http_access allow IPCop_unrestricted_ips" ;
3168 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3170 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3172 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3174 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3176 print FILE
" for_inetusers" ;
3178 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3180 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3182 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3184 print FILE
" for_acl_users" ;
3186 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3188 print FILE
" !for_acl_users" ;
3190 } else { print FILE
" for_inetusers" ; }
3192 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3194 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3196 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3198 print FILE
" for_acl_users" ;
3200 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3202 print FILE
" !for_acl_users" ;
3204 } else { print FILE
" for_inetusers" ; }
3210 if (!- z
$acl_src_unrestricted_mac )
3212 print FILE
"http_access allow IPCop_unrestricted_mac" ;
3213 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3215 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3217 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3219 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3221 print FILE
" for_inetusers" ;
3223 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3225 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3227 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3229 print FILE
" for_acl_users" ;
3231 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3233 print FILE
" !for_acl_users" ;
3235 } else { print FILE
" for_inetusers" ; }
3237 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3239 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3241 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3243 print FILE
" for_acl_users" ;
3245 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3247 print FILE
" !for_acl_users" ;
3249 } else { print FILE
" for_inetusers" ; }
3255 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3257 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3258 if (!- z
$extgrp ) { print FILE
"http_access allow IPCop_networks for_extended_users \n " ; }
3263 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3264 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3265 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3266 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3267 (!- z
" $ntlmdir /msntauth.denyusers" )
3271 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3272 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3273 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3274 (!- z
" $raddir /radauth.denyusers" )
3278 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3279 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3280 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3281 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3282 (!- z
" $identdir /identauth.denyusers" )
3286 print FILE
"http_access deny for_acl_users" ;
3287 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3291 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3293 print FILE
"http_access allow" ;
3294 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3295 print FILE
" !within_timeframe" ;
3297 print FILE
" within_timeframe" ; }
3298 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3299 print FILE
" !on_ident_aware_hosts \n " ;
3302 print FILE
"http_access allow IPCop_networks" ;
3305 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3306 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3307 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3308 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3309 (!- z
" $ntlmdir /msntauth.allowusers" )
3313 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3314 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3315 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3316 (!- z
" $raddir /radauth.allowusers" )
3320 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3321 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3322 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3323 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3324 (!- z
" $identdir /identauth.allowusers" )
3328 print FILE
" for_acl_users" ;
3329 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3330 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3331 print FILE
" for_inetusers" ;
3333 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3335 print FILE
" !concurrent" ;
3337 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3338 print FILE
" !within_timeframe" ;
3340 print FILE
" within_timeframe" ; }
3341 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3344 print FILE
"http_access deny all \n\n " ;
3346 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3347 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3349 print FILE
"#Strip HTTP Header \n " ;
3351 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3353 print FILE
"header_access X-Forwarded-For deny all \n " ;
3355 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3357 print FILE
"header_access Via deny all \n " ;
3359 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3361 print FILE
"header_access User-Agent deny all \n " ;
3363 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3365 print FILE
"header_access Referer deny all \n " ;
3370 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3372 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3374 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3376 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3378 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3384 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3385 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPCop_unrestricted_ips \n " ; }
3386 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPCop_unrestricted_mac \n " ; }
3387 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3389 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3391 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3392 print FILE
"http_reply_access allow all \n\n " ;
3396 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3397 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3399 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3402 $replybodymaxsize = 1024 * $proxysettings { 'MAX_INCOMING_SIZE' };
3403 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3404 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_ips \n " ; }
3405 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_mac \n " ; }
3406 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3408 if (!- z
$extgrp ) { print FILE
"reply_body_max_size 0 allow for_extended_users \n " ; }
3411 print FILE
"reply_body_max_size $replybodymaxsize allow all \n\n " ;
3413 print FILE
"visible_hostname" ;
3414 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3416 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3418 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3421 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n\n " ; }
3423 # Write the parent proxy info, if needed.
3424 if ( $remotehost ne '' )
3426 # Enter authentication for the parent cache (format is login=user:password)
3427 if ( $proxy1 eq 'YES' ) {
3429 cache_peer $remotehost parent $remoteport 3130 login= $proxysettings {'UPSTREAM_USER'}: $proxysettings {'UPSTREAM_PASSWORD'} default no-query
3434 # Not using authentication with the parent cache
3435 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3436 if ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3439 print FILE
"never_direct allow all \n\n " ;
3441 if ( $urlfilter_addon ) {
3442 if ( $proxysettings { 'ENABLE_FILTER' } eq 'on' )
3445 redirect_program /usr/bin/squidGuard
3446 redirect_children $filtersettings {'CHILDREN'}
3452 if ( $updacclrtr_addon ) {
3453 if ( $proxysettings { 'ENABLE_UPDACCEL' } eq 'on' )
3456 redirect_program /usr/local/bin/updacclrtr
3457 redirect_children $updaccsettings {'ACCELERATORS'}
3463 if (( $proxysettings { 'TRANSPARENT' } eq 'on' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ))
3466 httpd_accel_host virtual
3468 httpd_accel_with_proxy on
3469 httpd_accel_uses_host_header on
3476 # -------------------------------------------------------------------
3480 my ( $str_user , $str_pass , $str_group ) = @_ ;
3481 my @groupmembers =();
3483 if ( $str_pass eq 'lEaVeAlOnE' )
3485 open ( FILE
, " $userdb " );
3486 @groupmembers = < FILE
>;
3488 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3489 & deluser
( $str_user );
3490 open ( FILE
, ">> $userdb " );
3492 print FILE
" $str_user $str_pass " ;
3495 & deluser
( $str_user );
3496 system ( "/usr/bin/htpasswd -b $userdb $str_user $str_pass " );
3499 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3500 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3501 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3503 print FILE
" $str_user \n " ;
3509 # -------------------------------------------------------------------
3513 my ( $str_user ) = @_ ;
3515 my @groupmembers =();
3518 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3521 open ( FILE
, " $groupfile " );
3522 @groupmembers = < FILE
>;
3524 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3525 open ( FILE
, "> $groupfile " );
3527 print FILE
@templist ;
3532 open ( FILE
, " $userdb " );
3533 @groupmembers = < FILE
>;
3535 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3536 open ( FILE
, "> $userdb " );
3538 print FILE
@templist ;
3544 # -------------------------------------------------------------------