]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/proxy.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 # enable only the following on debugging purpose
26 #use CGI::Carp 'fatalsToBrowser';
28 require '/var/ipfire/general-functions.pl' ;
29 require "${General::swroot}/lang.pl" ;
30 require "${General::swroot}/header.pl" ;
32 my @squidversion = `/usr/sbin/squid -v` ;
37 my %mainsettings = ();
38 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
39 & General
:: readhash
( "/srv/web/ipfire/html/themes/" . $mainsettings { 'THEME' }. "/include/colors.txt" , \
%color );
43 my %filtersettings =();
44 my %xlratorsettings =();
45 my %stdproxysettings =();
51 my @throttle_limits =( 64 , 128 , 256 , 384 , 512 , 1024 , 2048 , 3072 , 5120 );
52 my $throttle_binary = "bin|cab|exe|gz|rar|sea|tar|tgz|zip" ;
53 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi" ;
54 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|qt|ra?m" ;
56 my $def_ports_safe = "80 # http \n 21 # ftp \n 443 # https \n 563 # snews \n 70 # gopher \n 210 # wais \n 1025-65535 # unregistered ports \n 280 # http-mgmt \n 488 # gss-http \n 591 # filemaker \n 777 # multiling http \n 800 # Squids port (for icons) \n " ;
57 my $def_ports_ssl = "443 # https \n 563 # snews \n " ;
62 my $hintcolour = '#FFFFCC' ;
63 my $ncsa_buttontext = '' ;
78 my $replybodymaxsize = 0 ;
79 my $browser_regexp = '' ;
83 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
84 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
85 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
86 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
87 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
88 my $credir = "${General::swroot}/proxy/advanced/cre" ;
90 my $userdb = " $ncsadir /passwd" ;
91 my $stdgrp = " $ncsadir /standard.grp" ;
92 my $extgrp = " $ncsadir /extended.grp" ;
93 my $disgrp = " $ncsadir /disabled.grp" ;
95 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
96 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
97 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
99 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
100 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
101 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
103 my $identhosts = " $identdir /hosts" ;
105 my $authdir = "/usr/lib/squid/" ;
106 my $errordir = "/usr/lib/squid/errors" ;
108 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
109 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
110 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
111 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
112 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
113 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
114 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
115 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
116 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
117 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
118 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
119 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
120 my $acl_include = " $acldir /include.acl" ;
122 my $updaccelversion = 'n/a' ;
123 my $urlfilterversion = 'n/a' ;
125 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
126 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
127 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
128 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
129 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
130 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
132 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
133 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
135 unless (- e
$userdb ) { system ( "touch $userdb " ); }
136 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
137 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
138 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
140 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
141 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
142 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
143 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
144 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
145 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
146 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
147 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
148 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
149 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
150 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
151 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
152 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
154 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
155 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
157 open FILE
, $browserdb ;
158 @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
>;
161 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
162 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
164 & Header
:: showhttpheaders
();
166 $proxysettings { 'ACTION' } = '' ;
167 $proxysettings { 'VALID' } = '' ;
169 $proxysettings { 'ENABLE' } = 'off' ;
170 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
171 $proxysettings { 'TRANSPARENT' } = 'off' ;
172 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
173 $proxysettings { 'PROXY_PORT' } = '800' ;
174 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
175 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
176 $proxysettings { 'ERR_LANGUAGE' } = 'German' ;
177 $proxysettings { 'ERR_DESIGN' } = 'ipfire' ;
178 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
179 $proxysettings { 'FORWARD_VIA' } = 'off' ;
180 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
181 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
182 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
183 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
184 $proxysettings { 'UPSTREAM_USER' } = '' ;
185 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
186 $proxysettings { 'LOGGING' } = 'off' ;
187 $proxysettings { 'LOGQUERY' } = 'off' ;
188 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
189 $proxysettings { 'CACHE_MEM' } = '2' ;
190 $proxysettings { 'CACHE_SIZE' } = '50' ;
191 $proxysettings { 'MAX_SIZE' } = '4096' ;
192 $proxysettings { 'MIN_SIZE' } = '0' ;
193 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
194 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
195 $proxysettings { 'L1_DIRS' } = '16' ;
196 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
197 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
198 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
199 $proxysettings { 'NO_PROXY_LOCAL' } = 'off' ;
200 $proxysettings { 'NO_PROXY_LOCAL_BLUE' } = 'off' ;
201 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
202 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
203 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
204 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
205 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
206 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
207 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
208 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
209 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
210 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
211 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
212 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
213 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
214 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
215 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
216 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
217 $proxysettings { 'FAKE_USERAGENT' } = '' ;
218 $proxysettings { 'FAKE_REFERER' } = '' ;
219 $proxysettings { 'AUTH_METHOD' } = 'none' ;
220 $proxysettings { 'AUTH_REALM' } = '' ;
221 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
222 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
223 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
224 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
225 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
226 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
227 $proxysettings { 'NCSA_USERNAME' } = '' ;
228 $proxysettings { 'NCSA_GROUP' } = '' ;
229 $proxysettings { 'NCSA_PASS' } = '' ;
230 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
231 $proxysettings { 'LDAP_BASEDN' } = '' ;
232 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
233 $proxysettings { 'LDAP_SERVER' } = '' ;
234 $proxysettings { 'LDAP_PORT' } = '389' ;
235 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
236 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
237 $proxysettings { 'LDAP_GROUP' } = '' ;
238 $proxysettings { 'NTLM_DOMAIN' } = '' ;
239 $proxysettings { 'NTLM_PDC' } = '' ;
240 $proxysettings { 'NTLM_BDC' } = '' ;
241 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
242 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
243 $proxysettings { 'RADIUS_SERVER' } = '' ;
244 $proxysettings { 'RADIUS_PORT' } = '1812' ;
245 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
246 $proxysettings { 'RADIUS_SECRET' } = '' ;
247 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
248 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
249 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
250 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
251 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
252 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
253 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
254 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
255 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
256 $proxysettings { 'CHILDREN' } = '5' ;
258 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
260 & Header
:: getcgihash
( \
%proxysettings );
262 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
263 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
264 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
265 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
267 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
269 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
272 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
274 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
275 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
276 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
278 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
279 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
281 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
282 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
284 if (! $errormessage ) {
285 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
286 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
288 $proxysettings { 'NCSA_USERNAME' } = '' ;
289 $proxysettings { 'NCSA_GROUP' } = '' ;
290 $proxysettings { 'NCSA_PASS' } = '' ;
291 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
294 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
296 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
297 & deluser
( $proxysettings { 'ID' });
300 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
301 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
302 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
304 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
306 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
307 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
308 @temp = split ( /:/ , $proxysettings { 'ID' });
309 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
310 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
311 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
312 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
315 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }))
317 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
318 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
319 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
320 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
321 $errormessage = $Lang :: tr
{ 'invalid input' };
324 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
326 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
329 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
330 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
332 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
335 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
336 ( $proxysettings { 'CACHE_MEM' } < 1 ))
338 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
341 my @free = `/usr/bin/free` ;
342 $free [ 1 ] =~ m/(\d+)/ ;
343 $cachemem = int $1 / 2048 ;
344 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
345 $proxysettings { 'CACHE_MEM' } = $cachemem ;
347 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
349 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
352 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
354 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
357 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
359 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
362 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
364 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
367 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
369 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
372 if (!( $proxysettings { 'CHILDREN' } =~ /^\d+$/ ) || ( $proxysettings { 'CHILDREN' } < 1 ))
374 $errormessage = $Lang :: tr
{ 'advproxy invalid num of children' };
377 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
379 $browser_regexp = '' ;
380 foreach ( @useragentlist )
383 @useragent = split ( /,/ );
384 if ( $proxysettings { 'UA_' . $useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " $useragent [2]|" ; }
386 chop ( $browser_regexp );
387 if (! $browser_regexp )
389 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
393 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
395 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
396 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
397 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
399 if ( $netsettings { 'BLUE_DEV' })
401 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
402 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
404 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
408 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
410 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
415 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
416 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
418 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
421 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
423 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
426 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
428 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
431 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
433 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
436 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
438 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
442 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
444 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
446 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
450 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
452 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
454 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
458 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
460 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
462 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
465 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
467 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
470 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
472 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
475 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
477 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
479 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
484 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
486 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
488 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
491 if ( $proxysettings { 'NTLM_PDC' } eq '' )
493 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
496 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
498 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
501 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
503 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
507 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
509 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
511 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
514 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
516 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
519 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
521 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
526 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
529 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
530 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
531 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
532 if (( $proxy1 ne $proxy2 ))
534 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
542 $proxysettings { 'VALID' } = 'no' ; }
544 $proxysettings { 'VALID' } = 'yes' ; }
546 if ( $proxysettings { 'VALID' } eq 'yes' )
550 delete $proxysettings { 'SRC_SUBNETS' };
551 delete $proxysettings { 'SRC_BANNED_IP' };
552 delete $proxysettings { 'SRC_BANNED_MAC' };
553 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
554 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
555 delete $proxysettings { 'DST_NOCACHE' };
556 delete $proxysettings { 'DST_NOAUTH' };
557 delete $proxysettings { 'PORTS_SAFE' };
558 delete $proxysettings { 'PORTS_SSL' };
559 delete $proxysettings { 'MIME_TYPES' };
560 delete $proxysettings { 'NTLM_ALLOW_USERS' };
561 delete $proxysettings { 'NTLM_DENY_USERS' };
562 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
563 delete $proxysettings { 'RADIUS_DENY_USERS' };
564 delete $proxysettings { 'IDENT_HOSTS' };
565 delete $proxysettings { 'IDENT_ALLOW_USERS' };
566 delete $proxysettings { 'IDENT_DENY_USERS' };
568 delete $proxysettings { 'CRE_GROUPS' };
569 delete $proxysettings { 'CRE_SVHOSTS' };
571 delete $proxysettings { 'NCSA_USERNAME' };
572 delete $proxysettings { 'NCSA_GROUP' };
573 delete $proxysettings { 'NCSA_PASS' };
574 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
576 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
577 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
578 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
579 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
580 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
581 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
582 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
584 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
585 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
587 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
589 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
590 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
591 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
592 $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' };
593 $stdproxysettings { 'ENABLE_CLAMAV' } = $proxysettings { 'ENABLE_CLAMAV' };
594 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
599 system ( '/usr/local/bin/squidctrl' , 'disable' );
600 unlink "${General::swroot}/proxy/enable" ;
601 unlink "${General::swroot}/proxy/transparent" ;
602 unlink "${General::swroot}/proxy/enable_blue" ;
603 unlink "${General::swroot}/proxy/transparent_blue" ;
605 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
606 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable" );
607 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
608 if ( $proxysettings { 'TRANSPARENT' } eq 'on' && $proxysettings { 'ENABLE' } eq 'on' ) {
609 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent" ); }
610 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
611 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable_blue" );
612 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
613 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
614 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
616 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/squidctrl restart >/dev/null 2>&1' ); }
620 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
622 system ( '/usr/local/bin/squidctrl flush >/dev/null 2>&1' );
627 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
628 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
629 } elsif (- e
"${General::swroot}/proxy/settings" ) {
630 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
635 $checked { 'ENABLE' }{ 'off' } = '' ;
636 $checked { 'ENABLE' }{ 'on' } = '' ;
637 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
639 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
640 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
641 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
643 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
644 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
645 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
647 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
648 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
649 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
651 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
652 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
653 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
655 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
656 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
657 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
658 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
659 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
660 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
661 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
662 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
663 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
664 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
665 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
666 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
668 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
669 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
670 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
671 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
672 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
673 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
675 $checked { 'LOGGING' }{ 'off' } = '' ;
676 $checked { 'LOGGING' }{ 'on' } = '' ;
677 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
678 $checked { 'LOGQUERY' }{ 'off' } = '' ;
679 $checked { 'LOGQUERY' }{ 'on' } = '' ;
680 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
681 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
682 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
683 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
685 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
686 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
688 $checked { 'NO_PROXY_LOCAL' }{ 'off' } = '' ;
689 $checked { 'NO_PROXY_LOCAL' }{ 'on' } = '' ;
690 $checked { 'NO_PROXY_LOCAL' }{ $proxysettings { 'NO_PROXY_LOCAL' }} = "checked='checked'" ;
691 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'off' } = '' ;
692 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'on' } = '' ;
693 $checked { 'NO_PROXY_LOCAL_BLUE' }{ $proxysettings { 'NO_PROXY_LOCAL_BLUE' }} = "checked='checked'" ;
695 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
696 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
697 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
699 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
700 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
701 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
702 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
703 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
705 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
706 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
707 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
708 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
709 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
710 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
711 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
713 $checked { 'TIME_MON' }{ 'off' } = '' ;
714 $checked { 'TIME_MON' }{ 'on' } = '' ;
715 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
716 $checked { 'TIME_TUE' }{ 'off' } = '' ;
717 $checked { 'TIME_TUE' }{ 'on' } = '' ;
718 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
719 $checked { 'TIME_WED' }{ 'off' } = '' ;
720 $checked { 'TIME_WED' }{ 'on' } = '' ;
721 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
722 $checked { 'TIME_THU' }{ 'off' } = '' ;
723 $checked { 'TIME_THU' }{ 'on' } = '' ;
724 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
725 $checked { 'TIME_FRI' }{ 'off' } = '' ;
726 $checked { 'TIME_FRI' }{ 'on' } = '' ;
727 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
728 $checked { 'TIME_SAT' }{ 'off' } = '' ;
729 $checked { 'TIME_SAT' }{ 'on' } = '' ;
730 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
731 $checked { 'TIME_SUN' }{ 'off' } = '' ;
732 $checked { 'TIME_SUN' }{ 'on' } = '' ;
733 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
735 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
736 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
737 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
738 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
740 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
741 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
742 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
743 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
744 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
745 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
746 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
747 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
748 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
750 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
751 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
752 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
754 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
755 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
756 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
758 foreach ( @useragentlist ) {
759 @useragent = split ( /,/ );
760 $checked { 'UA_' . $useragent [ 0 ]}{ 'off' } = '' ;
761 $checked { 'UA_' . $useragent [ 0 ]}{ 'on' } = '' ;
762 $checked { 'UA_' . $useragent [ 0 ]}{ $proxysettings { 'UA_' . $useragent [ 0 ]}} = "checked='checked'" ;
765 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
766 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
767 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
768 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
769 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
770 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
771 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
773 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
775 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
776 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
777 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
779 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
780 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
781 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
783 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
785 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
787 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
789 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
790 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
791 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
793 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
794 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
795 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
797 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
798 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
799 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
801 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
802 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
803 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
805 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
806 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
807 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
809 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
810 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
811 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
813 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
814 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
815 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
817 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
818 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
819 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
821 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
822 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
823 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
825 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
826 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
827 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
829 $checked { 'ENABLE_CLAMAV' }{ 'off' } = '' ;
830 $checked { 'ENABLE_CLAMAV' }{ 'on' } = '' ;
831 $checked { 'ENABLE_CLAMAV' }{ $proxysettings { 'ENABLE_CLAMAV' }} = "checked='checked'" ;
833 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
835 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
838 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
839 print "<font class='base'> $errormessage </font> \n " ;
843 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
845 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
846 $squidversion [ 0 ] =~ s/^\s+//g ;
847 $squidversion [ 0 ] =~ s/\s+$//g ;
849 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
852 # ===================================================================
854 # ===================================================================
856 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
858 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
860 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
865 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
868 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
869 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
870 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
871 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
874 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
875 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
876 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
877 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
882 if ( $netsettings { 'BLUE_DEV' }) {
883 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
884 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
886 print "<td colspan='2'> </td>" ;
889 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
890 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
895 if ( $netsettings { 'BLUE_DEV' }) {
896 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
897 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
899 print "<td colspan='2'> </td>" ;
902 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
904 <select name='ERR_LANGUAGE'>
907 foreach (< $errordir /*>) {
909 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
910 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
918 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
919 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
920 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
921 <td class='base'><select name='ERR_DESIGN'>
922 <option value='ipfire' $selected {'ERR_DESIGN'}{'ipfire'}>IPFire</option>
923 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
927 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
928 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
935 <tr><td class='base' width='50%' ><b> $Lang ::tr{'advproxy redirector children'}</b><input type='text' name='CHILDREN' value=' $proxysettings {'CHILDREN'}' size='5' /></td>
938 if ( - e
"/usr/bin/squidclamav" ) {
939 print "<td class='base' width='33%'><b> $Lang ::tr{'advproxy squidclamav'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_CLAMAV' $checked{'ENABLE_CLAMAV'}{'on'} /></td></tr>" ;
943 print "<td class='base' width='33%'></td></tr>" ;
947 <tr><td class='base' width='50%'><b> $Lang ::tr{'advproxy url filter'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_FILTER' $checked{'ENABLE_FILTER'}{'on'} /></td>
948 <td class='base' width='50%'><b> $Lang ::tr{'advproxy update accelerator'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_UPDXLRATOR' $checked{'ENABLE_UPDXLRATOR'}{'on'} /></td></tr>
953 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
956 <td class='base'> $Lang ::tr{'advproxy via forwarding'}:</td><td><input type='checkbox' name='FORWARD_VIA' $checked{'FORWARD_VIA'}{'on'} /></td>
957 <td class='base'> $Lang ::tr{'advproxy upstream proxy host:port'}<img src='/blob.gif' alt='*' /></td><td><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
960 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td><td><input type='checkbox' name='FORWARD_IPADDRESS' $checked{'FORWARD_IPADDRESS'}{'on'} /></td>
961 <td class='base'> $Lang ::tr{'advproxy upstream username'}<img src='/blob.gif' alt='*' /></td><td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
964 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td><td><input type='checkbox' name='FORWARD_USERNAME' $checked{'FORWARD_USERNAME'}{'on'} />
965 <td class='base'> $Lang ::tr{'advproxy upstream password'}:<img src='/blob.gif' alt='*' /></td><td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
968 <td class='base' colspan='4'> $Lang ::tr{'advproxy no connection auth'}:<input type='checkbox' name='NO_CONNECTION_AUTH' $checked{'NO_CONNECTION_AUTH'}{'on'} /></td>
974 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
977 <td class='base'> $Lang ::tr{'advproxy log enabled'}:<input type='checkbox' name='LOGGING' $checked{'LOGGING'}{'on'} /></td>
978 <td class='base'> $Lang ::tr{'advproxy log query'}:<input type='checkbox' name='LOGQUERY' $checked{'LOGQUERY'}{'on'} /></td>
979 <td class='base'> $Lang ::tr{'advproxy log useragent'}:<input type='checkbox' name='LOGUSERAGENT' $checked{'LOGUSERAGENT'}{'on'} /></td>
985 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
988 <td width='35%'></td><td width='15%'></td><td width='35%'></td><td width='15%'></td>
991 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
992 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
993 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
994 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
997 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
998 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
999 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
1000 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
1003 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
1004 <td class='base'><select name='L1_DIRS'>
1005 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
1006 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
1007 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
1008 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
1009 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
1011 <td colspan='2' rowspan= '5' valign='top' class='base'>
1012 <table cellspacing='0' cellpadding='0'>
1014 <!-- intentionally left empty -->
1017 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
1020 <!-- intentionally left empty -->
1023 <!-- intentionally left empty -->
1026 <td align=center><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1030 print $proxysettings { 'DST_NOCACHE' };
1039 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1040 <td class='base'><select name='MEM_POLICY'>
1041 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1042 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1043 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1044 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1048 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1049 <td class='base'><select name='CACHE_POLICY'>
1050 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1051 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1052 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1053 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1057 <td colspan='2'> </td>
1060 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1061 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1065 <table width='100%'>
1067 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1070 <td width='25%' align=center></td> <td width='20%' align=center></td><td width='25%' align=center></td><td width='30%' align=center></td>
1073 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}:</td>
1074 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}:</td>
1077 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1080 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1084 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1087 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1094 <table width='100%'>
1096 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1099 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1102 <td colspan='4' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1105 <td colspan='2' rowspan='4'><textarea name='SRC_SUBNETS' cols='32' rows='3' wrap='off'>
1109 if (! $proxysettings { 'SRC_SUBNETS' })
1111 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1112 if ( $netsettings { 'BLUE_DEV' })
1114 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1116 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1123 $line = $Lang :: tr
{ 'advproxy no internal proxy on green' };
1124 $line =~ s/Green/<font color="$Header::colourgreen">Green<\/ font
>/ i
;
1125 print "<td class='base'> $line :</td> \n " ;
1127 <td><input type='checkbox' name='NO_PROXY_LOCAL' $checked {'NO_PROXY_LOCAL'}{'on'} /></td>
1131 if ( $netsettings { 'BLUE_DEV' }) {
1132 $line = $Lang :: tr
{ 'advproxy no internal proxy on blue' };
1133 $line =~ s/Blue/<font color="$Header::colourblue">Blue<\/ font
>/ i
;
1135 print "<td class='base'> $line :</td> \n " ;
1137 <td><input type='checkbox' name='NO_PROXY_LOCAL_BLUE' $checked {'NO_PROXY_LOCAL_BLUE'}{'on'} /></td>
1144 <td colspan='2'> </td>
1147 <td colspan='2'> </td>
1150 <table width='100%'>
1152 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1155 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1156 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1159 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='3' wrap='off'>
1163 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1167 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='3' wrap='off'>
1171 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1177 <table width='100%'>
1179 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1182 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1183 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1186 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='3' wrap='off'>
1190 print $proxysettings { 'SRC_BANNED_IP' };
1194 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='3' wrap='off'>
1198 print $proxysettings { 'SRC_BANNED_MAC' };
1209 # -------------------------------------------------------------------
1210 # CRE GUI - optional
1211 # -------------------------------------------------------------------
1213 if (- e
$cre_enabled ) { print <<END
1214 <table width='100%'>
1217 <td colspan='4'><b> $Lang ::tr{'advproxy classroom extensions'}</b> $Lang::tr{'advproxy enabled'}:<input type='checkbox' name='CLASSROOM_EXT' $checked{'CLASSROOM_EXT'}{'on'} /></td>
1220 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1226 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1228 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1229 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1232 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1233 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1238 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1241 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1245 print $proxysettings { 'CRE_GROUPS' };
1249 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1252 print $proxysettings { 'CRE_SVHOSTS' };
1260 print "</table><hr size='1'>" ;
1264 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1265 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1266 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1271 # -------------------------------------------------------------------
1275 <table width='100%'>
1277 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1279 <table width='100%'>
1281 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1282 <td width='1%'> </td>
1283 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1284 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1285 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1286 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1287 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1288 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1289 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1290 <td width='1%'> </td>
1291 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1292 <td width='1%'> </td>
1293 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1298 <select name='TIME_ACCESS_MODE'>
1299 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1300 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1304 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1305 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1306 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1307 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1308 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1309 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1310 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1313 <select name='TIME_FROM_HOUR'>
1316 for ( $i = 0 ; $i <= 24 ; $i ++) {
1317 $_ = sprintf ( " %02s " , $i );
1318 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1325 <select name='TIME_FROM_MINUTE'>
1328 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1329 $_ = sprintf ( " %02s " , $i );
1330 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1337 <select name='TIME_TO_HOUR'>
1340 for ( $i = 0 ; $i <= 24 ; $i ++) {
1341 $_ = sprintf ( " %02s " , $i );
1342 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1349 <select name='TIME_TO_MINUTE'>
1352 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1353 $_ = sprintf ( " %02s " , $i );
1354 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1362 <table width='100%'>
1364 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1367 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1368 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1369 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1370 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1374 <table width='100%'>
1376 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1379 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1380 <td width='20%' class='base'>
1381 <select name='THROTTLING_GREEN_TOTAL'>
1385 foreach ( @throttle_limits ) {
1386 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1390 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1393 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1394 <td width='30%' class='base'>
1395 <select name='THROTTLING_GREEN_HOST'>
1399 foreach ( @throttle_limits ) {
1400 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1404 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1411 if ( $netsettings { 'BLUE_DEV' }) {
1414 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1416 <select name='THROTTLING_BLUE_TOTAL'>
1420 foreach ( @throttle_limits ) {
1421 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1425 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1428 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1430 <select name='THROTTLING_BLUE_HOST'>
1434 foreach ( @throttle_limits ) {
1435 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1439 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1449 <table width='100%'>
1451 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1454 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1455 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1456 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1457 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1458 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1459 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1460 <td width='15%'> </td>
1461 <td width='10%'> </td>
1465 <table width='100%'>
1467 <td colspan='4'><b> $Lang ::tr{'advproxy MIME filter'}</b> $Lang::tr{'advproxy enabled'}:<input type='checkbox' name='ENABLE_MIME_FILTER' $checked{'ENABLE_MIME_FILTER'}{'on'} /></td>
1471 if ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' ){
1474 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1479 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1483 print $proxysettings { 'MIME_TYPES' };
1497 <table width='100%'>
1499 <td colspan='4'><b> $Lang ::tr{'advproxy web browser'}</b> $Lang::tr{'advproxy UA enable filter'}:<input type='checkbox' name='ENABLE_BROWSER_CHECK' $checked{'ENABLE_BROWSER_CHECK'}{'on'} /></td>
1503 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ){
1509 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1514 <table width='100%'>
1518 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1519 for ( $i = 0 ; $i <= 3 ; $i ++) {
1520 if ( $i eq 0 ) { print "<tr> \n " ; }
1521 if (( $n + $i ) < @useragentlist ) {
1522 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1523 print "<td width='15%'> $useragent [1]:<\/td> \n " ;
1524 print "<td width='10%'><input type='checkbox' name='UA_ $useragent [0]' $checked {'UA_'. $useragent [0]}{'on'} /></td> \n " ;
1526 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1533 <table width='100%'>
1535 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1538 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1539 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1542 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='56' /></td>
1543 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='56' /></td>
1551 <table width='100%'>
1553 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1556 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1557 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1558 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1559 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1560 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1561 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1567 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1569 <table width='100%'>
1571 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1574 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1577 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1578 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1579 <td colspan='2' rowspan= '6' valign='top' class='base'>
1580 <table cellpadding='0' cellspacing='0'>
1582 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1585 <!-- intentionally left empty -->
1588 <!-- intentionally left empty -->
1591 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1594 <!-- intentionally left empty -->
1597 <!-- intentionally left empty -->
1600 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1603 <!-- intentionally left empty -->
1606 <!-- intentionally left empty -->
1609 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1613 print $proxysettings { 'DST_NOAUTH' };
1622 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1623 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1626 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1627 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1630 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1631 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1634 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1635 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1638 <td colspan='2'> </td>
1645 # ===================================================================
1646 # NCSA auth settings
1647 # ===================================================================
1649 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1652 <table width='100%'>
1654 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1657 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1658 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1659 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1660 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1663 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1671 # ===================================================================
1672 # IDENTD auth settings
1673 # ===================================================================
1675 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1678 <table width='100%'>
1680 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1683 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1684 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1685 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1686 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1689 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1690 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1695 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1696 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1699 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1702 if (! $proxysettings { 'IDENT_HOSTS' }) {
1703 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1704 if ( $netsettings { 'BLUE_DEV' }) {
1705 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1708 print $proxysettings { 'IDENT_HOSTS' };
1713 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1717 print $proxysettings { 'DST_NOAUTH' };
1724 <table width='100%'>
1726 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1729 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1730 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1731 <td width='25%'> </td>
1732 <td width='30%'> </td>
1735 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1736 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1737 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1738 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1741 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1742 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1745 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1749 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1751 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1753 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1757 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1759 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1766 # ===================================================================
1767 # NTLM auth settings
1768 # ===================================================================
1770 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1773 <table width='100%'>
1775 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1778 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1779 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1780 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1781 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1782 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1783 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1787 <table width='100%'>
1789 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1792 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1793 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1798 <table width='100%'>
1800 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1803 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1804 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1805 <td width='25%'> </td>
1806 <td width='30%'> </td>
1809 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1810 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1811 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1812 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1815 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1816 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1819 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1823 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1825 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1827 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1831 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1833 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1840 # ===================================================================
1841 # LDAP auth settings
1842 # ===================================================================
1844 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1847 <table width='100%'>
1849 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1852 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1853 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1854 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1855 <td class='base'><select name='LDAP_TYPE'>
1856 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1857 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1858 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1859 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1863 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1864 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1865 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1866 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1870 <table width='100%'>
1872 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1875 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1876 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1877 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1878 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1882 <table width='100%'>
1884 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1887 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
1888 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1896 # ===================================================================
1897 # RADIUS auth settings
1898 # ===================================================================
1900 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1903 <table width='100%'>
1905 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1908 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1909 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1910 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1911 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1914 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
1915 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1916 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1917 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1921 <table width='100%'>
1923 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1926 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1927 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1928 <td width='25%'> </td>
1929 <td width='30%'> </td>
1932 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1933 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1934 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1935 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1938 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1939 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1942 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1946 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
1948 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1950 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
1954 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
1956 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
1963 # ===================================================================
1969 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
1971 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1972 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1973 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1974 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1975 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
1976 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1977 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
1981 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1983 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
1984 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1985 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1986 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1987 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
1991 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
1993 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
1994 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
1998 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
2000 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
2001 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
2002 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
2003 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
2004 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
2005 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
2006 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
2010 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2012 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2013 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2014 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2015 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2016 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2017 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2018 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2022 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
2024 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
2025 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
2026 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
2027 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
2028 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
2029 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
2030 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
2031 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
2035 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2037 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2038 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2039 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2040 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2041 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2042 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2043 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2044 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2056 <table width='100%'>
2059 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2060 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2061 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2067 <table width='100%'>
2069 <td><img src='/blob.gif' align='top' alt='*' />
2070 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2072 <td align='right'> </td>
2079 & Header
:: closebox
();
2083 # ===================================================================
2084 # NCSA user management
2085 # ===================================================================
2087 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2089 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2090 <table width='100%'>
2092 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2095 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2096 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2099 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly " ; }
2102 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2104 <select name='NCSA_GROUP'>
2105 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2106 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2107 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2113 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2114 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2115 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2116 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2123 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2124 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2125 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2128 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2129 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2135 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2140 <table width='100%'>
2142 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2145 <table width='100%' align='center'>
2151 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2152 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2156 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2157 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2161 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2162 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2165 @userlist = sort ( @userlist );
2167 # If the password file contains entries, print entries and action icons
2169 if ( $userdb ne "" ) {
2172 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2173 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2174 <td class='boldbase' colspan='2' align='center'> </td>
2179 foreach $line ( @userlist )
2183 @temp = split ( /:/ , $line );
2184 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2185 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2187 print "<tr bgcolor=' $color {'color20'}'> \n " ; }
2189 print "<tr bgcolor=' $color {'color22'}'> \n " ; }
2192 <td align='center'> $temp [0]</td>
2196 if ( $temp [ 1 ] eq 'standard' ) {
2197 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2198 } elsif ( $temp [ 1 ] eq 'extended' ) {
2199 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2200 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2201 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2204 <td width='8%' align='center'>
2205 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2206 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2207 <input type='hidden' name='ID' value=' $line ' />
2208 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2212 <td width='8%' align='center'>
2213 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2214 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2215 <input type='hidden' name='ID' value=' $temp [0]' />
2216 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2229 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2230 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2231 <td class='base'> $Lang ::tr{'edit'}</td>
2232 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2233 <td class='base'> $Lang ::tr{'remove'}</td>
2240 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2251 & Header
:: closebox
();
2255 # ===================================================================
2257 & Header
:: closebigbox
();
2259 & Header
:: closepage
();
2261 # -------------------------------------------------------------------
2265 if (- e
" $acl_src_subnets " ) {
2266 open ( FILE
, " $acl_src_subnets " );
2267 delete $proxysettings { 'SRC_SUBNETS' };
2268 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2271 if (- e
" $acl_src_banned_ip " ) {
2272 open ( FILE
, " $acl_src_banned_ip " );
2273 delete $proxysettings { 'SRC_BANNED_IP' };
2274 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2277 if (- e
" $acl_src_banned_mac " ) {
2278 open ( FILE
, " $acl_src_banned_mac " );
2279 delete $proxysettings { 'SRC_BANNED_MAC' };
2280 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2283 if (- e
" $acl_src_unrestricted_ip " ) {
2284 open ( FILE
, " $acl_src_unrestricted_ip " );
2285 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2286 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2289 if (- e
" $acl_src_unrestricted_mac " ) {
2290 open ( FILE
, " $acl_src_unrestricted_mac " );
2291 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2292 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2295 if (- e
" $acl_dst_nocache " ) {
2296 open ( FILE
, " $acl_dst_nocache " );
2297 delete $proxysettings { 'DST_NOCACHE' };
2298 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2301 if (- e
" $acl_dst_noauth " ) {
2302 open ( FILE
, " $acl_dst_noauth " );
2303 delete $proxysettings { 'DST_NOAUTH' };
2304 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2307 if (- e
" $acl_ports_safe " ) {
2308 open ( FILE
, " $acl_ports_safe " );
2309 delete $proxysettings { 'PORTS_SAFE' };
2310 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2313 if (- e
" $acl_ports_ssl " ) {
2314 open ( FILE
, " $acl_ports_ssl " );
2315 delete $proxysettings { 'PORTS_SSL' };
2316 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2319 if (- e
" $mimetypes " ) {
2320 open ( FILE
, " $mimetypes " );
2321 delete $proxysettings { 'MIME_TYPES' };
2322 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2325 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2326 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2327 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2328 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2331 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2332 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2333 delete $proxysettings { 'NTLM_DENY_USERS' };
2334 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2337 if (- e
" $raddir /radauth.allowusers" ) {
2338 open ( FILE
, " $raddir /radauth.allowusers" );
2339 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2340 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2343 if (- e
" $raddir /radauth.denyusers" ) {
2344 open ( FILE
, " $raddir /radauth.denyusers" );
2345 delete $proxysettings { 'RADIUS_DENY_USERS' };
2346 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2349 if (- e
" $identdir /identauth.allowusers" ) {
2350 open ( FILE
, " $identdir /identauth.allowusers" );
2351 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2352 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2355 if (- e
" $identdir /identauth.denyusers" ) {
2356 open ( FILE
, " $identdir /identauth.denyusers" );
2357 delete $proxysettings { 'IDENT_DENY_USERS' };
2358 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2361 if (- e
" $identhosts " ) {
2362 open ( FILE
, " $identhosts " );
2363 delete $proxysettings { 'IDENT_HOSTS' };
2364 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2367 if (- e
" $cre_groups " ) {
2368 open ( FILE
, " $cre_groups " );
2369 delete $proxysettings { 'CRE_GROUPS' };
2370 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2373 if (- e
" $cre_svhosts " ) {
2374 open ( FILE
, " $cre_svhosts " );
2375 delete $proxysettings { 'CRE_SVHOSTS' };
2376 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2381 # -------------------------------------------------------------------
2385 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2386 undef $proxysettings { 'PORTS_SAFE' };
2389 s/^\s+//g ; s/\s+$//g ;
2393 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2395 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2396 @templist = split ( /-/ );
2397 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2398 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2402 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2403 undef $proxysettings { 'PORTS_SSL' };
2406 s/^\s+//g ; s/\s+$//g ;
2411 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2412 @templist = split ( /-/ );
2413 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2414 $proxysettings { 'PORTS_SSL' } .= $line . " \n " ;
2418 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2419 undef $proxysettings { 'DST_NOCACHE' };
2422 s/^\s+//g ; s/\s+$//g ;
2425 unless ( /^\./ ) { $_ = '.' . $_ ; }
2426 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2430 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2431 undef $proxysettings { 'SRC_SUBNETS' };
2434 s/^\s+//g ; s/\s+$//g ;
2437 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2438 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2442 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2443 undef $proxysettings { 'SRC_BANNED_IP' };
2446 s/^\s+//g ; s/\s+$//g ;
2449 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2450 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2454 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2455 undef $proxysettings { 'SRC_BANNED_MAC' };
2458 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2461 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2462 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2466 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2467 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2470 s/^\s+//g ; s/\s+$//g ;
2473 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2474 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2478 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2479 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2482 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2485 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2486 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2490 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2491 undef $proxysettings { 'DST_NOAUTH' };
2494 s/^\s+//g ; s/\s+$//g ;
2497 unless ( /^\./ ) { $_ = '.' . $_ ; }
2498 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2502 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2504 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2505 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2508 s/^\s+//g ; s/\s+$//g ;
2509 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2511 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2514 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2516 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2517 undef $proxysettings { 'NTLM_DENY_USERS' };
2520 s/^\s+//g ; s/\s+$//g ;
2521 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2523 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2526 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2528 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2529 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2532 s/^\s+//g ; s/\s+$//g ;
2533 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2535 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2538 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2540 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2541 undef $proxysettings { 'IDENT_DENY_USERS' };
2544 s/^\s+//g ; s/\s+$//g ;
2545 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2547 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2550 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2552 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2553 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2556 s/^\s+//g ; s/\s+$//g ;
2557 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2559 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2562 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2564 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2565 undef $proxysettings { 'RADIUS_DENY_USERS' };
2568 s/^\s+//g ; s/\s+$//g ;
2569 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2571 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2574 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2575 undef $proxysettings { 'IDENT_HOSTS' };
2578 s/^\s+//g ; s/\s+$//g ;
2581 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2582 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2586 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2587 undef $proxysettings { 'CRE_SVHOSTS' };
2590 s/^\s+//g ; s/\s+$//g ;
2593 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2594 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2599 # -------------------------------------------------------------------
2603 open ( FILE
, "> $acl_src_subnets " );
2605 if (! $proxysettings { 'SRC_SUBNETS' })
2607 print FILE
" $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
2608 if ( $netsettings { 'BLUE_DEV' })
2610 print FILE
" $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
2612 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2615 open ( FILE
, "> $acl_src_banned_ip " );
2617 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2620 open ( FILE
, "> $acl_src_banned_mac " );
2622 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2625 open ( FILE
, "> $acl_src_unrestricted_ip " );
2627 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2630 open ( FILE
, "> $acl_src_unrestricted_mac " );
2632 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2635 open ( FILE
, "> $acl_dst_nocache " );
2637 print FILE
$proxysettings { 'DST_NOCACHE' };
2640 open ( FILE
, "> $acl_dst_noauth " );
2642 print FILE
$proxysettings { 'DST_NOAUTH' };
2645 open ( FILE
, "> $acl_ports_safe " );
2647 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2650 open ( FILE
, "> $acl_ports_ssl " );
2652 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2655 open ( FILE
, "> $acl_dst_throttle " );
2657 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2659 @temp = split ( /\|/ , $throttle_binary );
2660 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2662 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2664 @temp = split ( /\|/ , $throttle_dskimg );
2665 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2667 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2669 @temp = split ( /\|/ , $throttle_mmedia );
2670 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2672 if (- s
$throttled_urls )
2674 open ( URLFILE
, $throttled_urls );
2677 foreach ( @temp ) { print FILE
; }
2681 open ( FILE
, "> $mimetypes " );
2683 print FILE
$proxysettings { 'MIME_TYPES' };
2686 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2688 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2691 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2693 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2696 open ( FILE
, "> $raddir /radauth.allowusers" );
2698 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2701 open ( FILE
, "> $raddir /radauth.denyusers" );
2703 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2706 open ( FILE
, "> $identdir /identauth.allowusers" );
2708 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2711 open ( FILE
, "> $identdir /identauth.denyusers" );
2713 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2716 open ( FILE
, "> $identhosts " );
2718 print FILE
$proxysettings { 'IDENT_HOSTS' };
2721 open ( FILE
, "> $cre_groups " );
2723 print FILE
$proxysettings { 'CRE_GROUPS' };
2726 open ( FILE
, "> $cre_svhosts " );
2728 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2732 # -------------------------------------------------------------------
2736 open ( FILE
, ">/srv/web/ipfire/html/proxy.pac" );
2738 print FILE
"function FindProxyForURL(url, host) \n " ;
2740 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2744 (isPlainHostName(host)) ||
2745 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2746 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2747 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2748 (isInNet(host, "169.254.0.0", "255.255.0.0")) ||
2749 (isInNet(host, "192.168.0.0", "255.255.0.0"))
2757 if ( $proxysettings { 'ENABLE' } eq 'on' )
2759 print FILE
"if ( \n " ;
2760 print FILE
" (isInNet(myIpAddress(), \" $netsettings {'GREEN_NETADDRESS'} \" , \" $netsettings {'GREEN_NETMASK'} \" ))" ;
2763 if (- e
" $acl_src_subnets " ) {
2764 open ( SUBNETS
, " $acl_src_subnets " );
2765 @templist = < SUBNETS
>;
2771 @temp = split ( /\/ /);
2773 ( $temp [ 0 ] ne $netsettings { 'GREEN_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'GREEN_NETMASK' }) &&
2774 ( $temp [ 0 ] ne $netsettings { 'BLUE_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'BLUE_NETMASK' })
2778 print FILE
" || \n (isInNet(myIpAddress(), \" $temp [0] \" , \" $temp [1] \" ))" ;
2788 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2792 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2794 print FILE
" \n else \n\n " ;
2796 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2800 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2802 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2811 # -------------------------------------------------------------------
2818 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2819 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2820 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2821 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2823 $delaypools = 1 ; } else { $delaypools = 0 ;
2826 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2828 $authrealm = "IPFire Advanced Proxy Server" ;
2830 $authrealm = $proxysettings { 'AUTH_REALM' };
2833 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2834 my ( $remotehost , $remoteport ) = ( /^(?:[a-zA-Z ]+\:\/ \
/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/ .* ?
) ?
$/);
2836 if ( $remoteport eq '' ) { $remoteport = 80 ; }
2838 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
2841 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
2842 # you make will be overwritten whenever you resave proxy settings using the
2845 # Instead, modify the file ' $acl_include ' and
2846 # then restart the proxy service using the web interface. Changes made to the
2847 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
2849 shutdown_lifetime 5 seconds
2854 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2855 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) { print FILE
" transparent" }
2856 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2859 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
2860 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2861 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) { print FILE
" transparent" }
2862 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
2868 acl QUERY urlpath_regex cgi-bin \\ ?
2872 if (!- z
$acl_dst_nocache ) {
2873 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache \"\n " ;
2874 print FILE
"cache deny no_cache_domains \n " ;
2879 cache_effective_user squid
2880 cache_effective_group squid
2883 pid_filename /var/run/squid.pid
2885 cache_mem $proxysettings {'CACHE_MEM'} MB
2886 cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256
2891 if (( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ))
2893 print FILE
"error_directory $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2895 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
2898 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
2900 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
2902 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
2904 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
2906 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
2908 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
2913 if ( $proxysettings { 'LOGGING' } eq 'on' )
2916 access_log /var/log/squid/access.log
2917 cache_log /var/log/squid/cache.log
2918 cache_store_log none
2921 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"useragent_log \/var\/log\/squid\/user_agent.log \n " ; }
2922 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
2925 access_log /dev/null
2927 cache_store_log none
2936 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
2938 print FILE
"forwarded_for on \n " ;
2940 print FILE
"forwarded_for off \n " ;
2942 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
2944 print FILE
"via on \n " ;
2946 print FILE
"via off \n " ;
2950 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
2952 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
2954 print FILE
"auth_param basic program $authdir /ncsa_auth $userdb \n " ;
2955 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
2956 print FILE
"auth_param basic realm $authrealm \n " ;
2957 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
2958 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
2961 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
2963 print FILE
"auth_param basic program $authdir /squid_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
2964 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
2965 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
2966 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
2968 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2970 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
2972 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2974 print FILE
" -u sAMAccountName -P" ;
2976 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
2978 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2980 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
2982 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
2984 print FILE
" -u cn -P" ;
2986 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
2988 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
2990 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
2992 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
2994 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
2995 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
2996 print FILE
" -u uid -P" ;
2998 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
2999 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3000 print FILE
"auth_param basic realm $authrealm \n " ;
3001 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3002 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3005 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
3007 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
3009 print FILE
"auth_param ntlm program $authdir /ntlm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
3010 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
3011 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
3012 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3014 print FILE
"auth_param basic program $authdir /msnt_auth \n " ;
3015 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3016 print FILE
"auth_param basic realm $authrealm \n " ;
3017 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3018 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3020 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
3022 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
3023 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
3024 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
3025 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3027 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
3029 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
3031 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
3038 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3040 print FILE
"auth_param basic program $authdir /squid_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3041 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3042 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3043 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3044 print FILE
"auth_param basic realm $authrealm \n " ;
3045 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3046 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3050 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3051 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
3053 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
3055 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
3057 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
3059 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
3062 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3064 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3066 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3068 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3070 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3073 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3076 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3077 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3079 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3082 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3086 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3088 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3090 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3092 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3094 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3096 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3098 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3100 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3103 if (!- z
$acl_dst_noauth ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth \"\n " ; }
3107 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3109 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
3111 print FILE
"acl within_timeframe time " ;
3112 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3113 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3114 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3115 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3116 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3117 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3118 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3119 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3120 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3121 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3122 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3124 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3125 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3129 acl all src 0.0.0.0/0.0.0.0
3130 acl localhost src 127.0.0.1/255.255.255.255
3133 open ( PORTS
, " $acl_ports_ssl " );
3138 foreach ( @temp ) { print FILE
"acl SSL_ports port $_ " ; }
3140 open ( PORTS
, " $acl_ports_safe " );
3145 foreach ( @temp ) { print FILE
"acl Safe_ports port $_ " ; }
3149 acl IPCop_http port $http_port
3150 acl IPCop_https port $https_port
3151 acl IPCop_ips dst $netsettings {'GREEN_ADDRESS'}
3152 acl IPCop_networks src " $acl_src_subnets "
3153 acl IPCop_servers dst " $acl_src_subnets "
3154 acl IPCop_green_network src $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3155 acl IPCop_green_servers dst $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3158 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_network src $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3159 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPCop_blue_servers dst $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3160 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPCop_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3161 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPCop_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3162 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPCop_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3163 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPCop_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3165 acl CONNECT method CONNECT
3169 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3172 #Classroom extensions
3173 acl IPCop_no_access_ips src " $acl_src_noaccess_ip "
3174 acl IPCop_no_access_mac arp " $acl_src_noaccess_mac "
3177 print FILE
"deny_info " ;
3178 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3179 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3181 print FILE
"ERR_ACCESS_DISABLED" ;
3183 print FILE
"ERR_ACCESS_DENIED" ;
3185 print FILE
" IPCop_no_access_ips \n " ;
3186 print FILE
"deny_info " ;
3187 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3188 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3190 print FILE
"ERR_ACCESS_DISABLED" ;
3192 print FILE
"ERR_ACCESS_DENIED" ;
3194 print FILE
" IPCop_no_access_mac \n " ;
3197 http_access deny IPCop_no_access_ips
3198 http_access deny IPCop_no_access_mac
3203 #Insert acl file and replace __VAR__ with correct values
3204 my $blue_net = '' ; #BLUE empty by default
3206 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3207 $blue_net = " $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'}" ;
3208 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3210 if (!- z
$acl_include )
3212 open ( ACL
, " $acl_include " );
3213 print FILE
" \n #Start of custom includes \n " ;
3215 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3216 $_ =~ s/__GREEN_NET__/$netsettings{'GREEN_NETADDRESS'}\/ $netsettings { 'GREEN_NETMASK' }/;
3217 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3218 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3219 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3222 print FILE
"#End of custom includes \n " ;
3225 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3229 #local machine, no restriction
3230 http_access allow localhost
3232 #GUI admin if local machine connects
3233 http_access allow IPCop_ips IPCop_networks IPCop_http
3234 http_access allow CONNECT IPCop_ips IPCop_networks IPCop_https
3236 #Deny not web services
3237 http_access deny !Safe_ports
3238 http_access deny CONNECT !SSL_ports
3243 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3245 print FILE
"#Set ident ACLs \n " ;
3246 if (!- z
$identhosts )
3248 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3249 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3250 print FILE
"ident_lookup_access deny all \n " ;
3252 print FILE
"ident_lookup_access allow all \n " ;
3254 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3258 print FILE
"#Set download throttling \n " ;
3260 if ( $netsettings { 'BLUE_DEV' })
3262 print FILE
"delay_pools 2 \n " ;
3264 print FILE
"delay_pools 1 \n " ;
3267 print FILE
"delay_class 1 3 \n " ;
3268 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3270 print FILE
"delay_parameters 1 " ;
3271 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3275 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3277 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3280 print FILE
" -1/-1 " ;
3281 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3285 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3287 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3291 if ( $netsettings { 'BLUE_DEV' })
3293 print FILE
"delay_parameters 2 " ;
3294 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3298 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3300 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3302 print FILE
" -1/-1 " ;
3303 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3307 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3309 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3314 print FILE
"delay_access 1 deny IPCop_ips \n " ;
3315 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPCop_unrestricted_ips \n " ; }
3316 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPCop_unrestricted_mac \n " ; }
3317 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3319 if ( $netsettings { 'BLUE_DEV' })
3321 print FILE
"delay_access 1 allow IPCop_green_network" ;
3322 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3324 print FILE
"delay_access 1 deny all \n " ;
3326 print FILE
"delay_access 1 allow all" ;
3327 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3331 if ( $netsettings { 'BLUE_DEV' })
3333 print FILE
"delay_access 2 deny IPCop_ips \n " ;
3334 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPCop_unrestricted_ips \n " ; }
3335 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPCop_unrestricted_mac \n " ; }
3336 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3337 print FILE
"delay_access 2 allow IPCop_blue_network" ;
3338 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3340 print FILE
"delay_access 2 deny all \n " ;
3343 print FILE
"delay_initial_bucket_level 100 \n " ;
3347 if ( $proxysettings { 'NO_PROXY_LOCAL' } eq 'on' )
3349 print FILE
"#Prevent internal proxy access to Green \n " ;
3350 print FILE
"http_access deny IPCop_green_servers !IPCop_green_network \n\n " ;
3353 if ( $proxysettings { 'NO_PROXY_LOCAL_BLUE' } eq 'on' )
3355 print FILE
"#Prevent internal proxy access from Blue \n " ;
3356 print FILE
"http_access allow IPCop_blue_network IPCop_blue_servers \n " ;
3357 print FILE
"http_access deny IPCop_blue_network IPCop_servers \n\n " ;
3361 #Set custom configured ACLs
3364 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPCop_banned_ips \n " ; }
3365 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPCop_banned_mac \n " ; }
3367 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3369 if (!- z
$acl_src_unrestricted_ip )
3371 print FILE
"http_access allow IPCop_unrestricted_ips to_domains_without_auth \n " ;
3373 if (!- z
$acl_src_unrestricted_mac )
3375 print FILE
"http_access allow IPCop_unrestricted_mac to_domains_without_auth \n " ;
3377 print FILE
"http_access allow IPCop_networks" ;
3378 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3379 print FILE
" !within_timeframe" ;
3381 print FILE
" within_timeframe" ; }
3382 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3383 print FILE
" to_domains_without_auth \n " ;
3386 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3388 print FILE
"http_access deny !for_inetusers" ;
3389 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3394 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3395 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3396 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3397 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3398 (!- z
" $identdir /identauth.denyusers" )
3401 print FILE
"http_access deny for_acl_users" ;
3402 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3406 if (!- z
$acl_src_unrestricted_ip )
3408 print FILE
"http_access allow IPCop_unrestricted_ips" ;
3409 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3411 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3413 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3415 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3417 print FILE
" for_inetusers" ;
3419 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3421 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3423 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3425 print FILE
" for_acl_users" ;
3427 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3429 print FILE
" !for_acl_users" ;
3431 } else { print FILE
" for_inetusers" ; }
3433 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3435 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3437 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3439 print FILE
" for_acl_users" ;
3441 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3443 print FILE
" !for_acl_users" ;
3445 } else { print FILE
" for_inetusers" ; }
3451 if (!- z
$acl_src_unrestricted_mac )
3453 print FILE
"http_access allow IPCop_unrestricted_mac" ;
3454 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3456 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3458 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3460 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3462 print FILE
" for_inetusers" ;
3464 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3466 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3468 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3470 print FILE
" for_acl_users" ;
3472 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3474 print FILE
" !for_acl_users" ;
3476 } else { print FILE
" for_inetusers" ; }
3478 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3480 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3482 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3484 print FILE
" for_acl_users" ;
3486 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3488 print FILE
" !for_acl_users" ;
3490 } else { print FILE
" for_inetusers" ; }
3496 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3498 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3499 if (!- z
$extgrp ) { print FILE
"http_access allow IPCop_networks for_extended_users \n " ; }
3504 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3505 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3506 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3507 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3508 (!- z
" $ntlmdir /msntauth.denyusers" )
3512 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3513 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3514 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3515 (!- z
" $raddir /radauth.denyusers" )
3519 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3520 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3521 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3522 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3523 (!- z
" $identdir /identauth.denyusers" )
3527 print FILE
"http_access deny for_acl_users" ;
3528 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3532 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3534 print FILE
"http_access allow" ;
3535 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3536 print FILE
" !within_timeframe" ;
3538 print FILE
" within_timeframe" ; }
3539 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3540 print FILE
" !on_ident_aware_hosts \n " ;
3543 print FILE
"http_access allow IPCop_networks" ;
3546 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3547 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3548 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3549 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3550 (!- z
" $ntlmdir /msntauth.allowusers" )
3554 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3555 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3556 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3557 (!- z
" $raddir /radauth.allowusers" )
3561 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3562 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3563 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3564 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3565 (!- z
" $identdir /identauth.allowusers" )
3569 print FILE
" for_acl_users" ;
3570 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3571 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3572 print FILE
" for_inetusers" ;
3574 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3576 print FILE
" !concurrent" ;
3578 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3579 print FILE
" !within_timeframe" ;
3581 print FILE
" within_timeframe" ; }
3582 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3585 print FILE
"http_access deny all \n\n " ;
3587 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3588 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3590 print FILE
"#Strip HTTP Header \n " ;
3592 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3594 print FILE
"header_access X-Forwarded-For deny all \n " ;
3596 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3598 print FILE
"header_access Via deny all \n " ;
3600 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3602 print FILE
"header_access User-Agent deny all \n " ;
3604 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3606 print FILE
"header_access Referer deny all \n " ;
3611 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3613 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3615 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3617 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3619 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3625 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3627 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3628 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPCop_unrestricted_ips \n " ; }
3629 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPCop_unrestricted_mac \n " ; }
3630 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3632 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3634 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3635 print FILE
"http_reply_access allow all \n\n " ;
3639 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3640 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3642 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3645 $replybodymaxsize = 1024 * $proxysettings { 'MAX_INCOMING_SIZE' };
3646 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3647 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_ips \n " ; }
3648 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size 0 allow IPCop_unrestricted_mac \n " ; }
3649 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3651 if (!- z
$extgrp ) { print FILE
"reply_body_max_size 0 allow for_extended_users \n " ; }
3654 print FILE
"reply_body_max_size $replybodymaxsize allow all \n\n " ;
3656 print FILE
"visible_hostname" ;
3657 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3659 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3661 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3664 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n\n " ; }
3666 # Write the parent proxy info, if needed.
3667 if ( $remotehost ne '' )
3669 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3671 # Enter authentication for the parent cache. Option format is
3672 # login=user:password ($proxy1='YES')
3673 # login=PASS ($proxy1='PASS')
3674 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3675 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3677 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3678 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3680 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3682 print FILE
" \n never_direct allow all \n\n " ;
3684 if (( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) || ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ) || ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ))
3686 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3687 print FILE
"url_rewrite_children $proxysettings {'CHILDREN'} \n\n " ;
3692 # -------------------------------------------------------------------
3696 my ( $str_user , $str_pass , $str_group ) = @_ ;
3697 my @groupmembers =();
3699 if ( $str_pass eq 'lEaVeAlOnE' )
3701 open ( FILE
, " $userdb " );
3702 @groupmembers = < FILE
>;
3704 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3705 & deluser
( $str_user );
3706 open ( FILE
, ">> $userdb " );
3708 print FILE
" $str_user $str_pass " ;
3711 & deluser
( $str_user );
3712 system ( "/usr/sbin/htpasswd -b $userdb $str_user $str_pass " );
3715 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3716 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3717 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3719 print FILE
" $str_user \n " ;
3725 # -------------------------------------------------------------------
3729 my ( $str_user ) = @_ ;
3731 my @groupmembers =();
3734 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3737 open ( FILE
, " $groupfile " );
3738 @groupmembers = < FILE
>;
3740 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3741 open ( FILE
, "> $groupfile " );
3743 print FILE
@templist ;
3748 open ( FILE
, " $userdb " );
3749 @groupmembers = < FILE
>;
3751 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3752 open ( FILE
, "> $userdb " );
3754 print FILE
@templist ;
3760 # -------------------------------------------------------------------