]>
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) 2008 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 ###############################################################################
22 # (c) 2004-2008 marco.s - http://www.advproxy.net
24 # This code is distributed under the terms of the GPL
26 # $Id: advproxy.cgi,v 3.0.0 2008/08/18 00:00:00 marco.s Exp $
31 # enable only the following on debugging purpose
33 #use CGI::Carp 'fatalsToBrowser';
35 require '/var/ipfire/general-functions.pl' ;
36 require "${General::swroot}/lang.pl" ;
37 require "${General::swroot}/header.pl" ;
39 my @squidversion = `/usr/sbin/squid -v` ;
44 my %mainsettings = ();
45 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
46 & General
:: readhash
( "/srv/web/ipfire/html/themes/" . $mainsettings { 'THEME' }. "/include/colors.txt" , \
%color );
50 my %filtersettings =();
51 my %xlratorsettings =();
52 my %stdproxysettings =();
58 my @throttle_limits =( 64 , 128 , 256 , 384 , 512 , 1024 , 2048 , 3072 , 5120 );
59 my $throttle_binary = "bin|cab|exe|gz|rar|sea|tar|tgz|zip" ;
60 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi" ;
61 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|qt|ra?m" ;
63 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 " ;
64 my $def_ports_ssl = "443 # https \n 563 # snews \n " ;
69 my $hintcolour = '#FFFFCC' ;
70 my $ncsa_buttontext = '' ;
85 my $replybodymaxsize = 0 ;
86 my $browser_regexp = '' ;
90 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
91 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
92 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
93 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
94 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
95 my $credir = "${General::swroot}/proxy/advanced/cre" ;
97 my $userdb = " $ncsadir /passwd" ;
98 my $stdgrp = " $ncsadir /standard.grp" ;
99 my $extgrp = " $ncsadir /extended.grp" ;
100 my $disgrp = " $ncsadir /disabled.grp" ;
102 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
103 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
104 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
106 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
107 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
108 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
110 my $identhosts = " $identdir /hosts" ;
112 my $authdir = "/usr/lib/squid/" ;
113 my $errordir = "/usr/lib/squid/errors" ;
115 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
116 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
117 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
118 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
119 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
120 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
121 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
122 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
123 my $acl_dst_noauth_dom = " $acldir /dst_noauth_dom.acl" ;
124 my $acl_dst_noauth_net = " $acldir /dst_noauth_net.acl" ;
125 my $acl_dst_noauth_url = " $acldir /dst_noauth_url.acl" ;
126 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
127 my $acl_dst_nocache_dom = " $acldir /dst_nocache_dom.acl" ;
128 my $acl_dst_nocache_net = " $acldir /dst_nocache_net.acl" ;
129 my $acl_dst_nocache_url = " $acldir /dst_nocache_url.acl" ;
130 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
131 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
132 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
133 my $acl_include = " $acldir /include.acl" ;
135 my $updaccelversion = 'n/a' ;
136 my $urlfilterversion = 'n/a' ;
138 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
139 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
140 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
141 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
142 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
143 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
145 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
146 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
148 unless (- e
$userdb ) { system ( "touch $userdb " ); }
149 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
150 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
151 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
153 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
154 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
155 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
156 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
157 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
158 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
159 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
160 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
161 unless (- e
$acl_dst_noauth_dom ) { system ( "touch $acl_dst_noauth_dom " ); }
162 unless (- e
$acl_dst_noauth_net ) { system ( "touch $acl_dst_noauth_net " ); }
163 unless (- e
$acl_dst_noauth_url ) { system ( "touch $acl_dst_noauth_url " ); }
164 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
165 unless (- e
$acl_dst_nocache_dom ) { system ( "touch $acl_dst_nocache_dom " ); }
166 unless (- e
$acl_dst_nocache_net ) { system ( "touch $acl_dst_nocache_net " ); }
167 unless (- e
$acl_dst_nocache_url ) { system ( "touch $acl_dst_nocache_url " ); }
168 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
169 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
170 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
171 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
173 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
174 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
176 open FILE
, $browserdb ;
177 @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
>;
180 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
181 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
183 & Header
:: showhttpheaders
();
185 $proxysettings { 'ACTION' } = '' ;
186 $proxysettings { 'VALID' } = '' ;
188 $proxysettings { 'ENABLE' } = 'off' ;
189 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
190 $proxysettings { 'TRANSPARENT' } = 'off' ;
191 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
192 $proxysettings { 'PROXY_PORT' } = '800' ;
193 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
194 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
195 $proxysettings { 'ERR_LANGUAGE' } = 'German' ;
196 $proxysettings { 'ERR_DESIGN' } = 'ipfire' ;
197 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
198 $proxysettings { 'FORWARD_VIA' } = 'off' ;
199 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
200 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
201 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
202 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
203 $proxysettings { 'UPSTREAM_USER' } = '' ;
204 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
205 $proxysettings { 'LOGGING' } = 'off' ;
206 $proxysettings { 'LOGQUERY' } = 'off' ;
207 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
208 $proxysettings { 'CACHE_MEM' } = '2' ;
209 $proxysettings { 'CACHE_SIZE' } = '50' ;
210 $proxysettings { 'MAX_SIZE' } = '4096' ;
211 $proxysettings { 'MIN_SIZE' } = '0' ;
212 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
213 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
214 $proxysettings { 'L1_DIRS' } = '16' ;
215 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
216 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
217 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
218 $proxysettings { 'NO_PROXY_LOCAL' } = 'off' ;
219 $proxysettings { 'NO_PROXY_LOCAL_BLUE' } = 'off' ;
220 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
221 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
222 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
223 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
224 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
225 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
226 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
227 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
228 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
229 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
230 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
231 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
232 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
233 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
234 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
235 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
236 $proxysettings { 'FAKE_USERAGENT' } = '' ;
237 $proxysettings { 'FAKE_REFERER' } = '' ;
238 $proxysettings { 'AUTH_METHOD' } = 'none' ;
239 $proxysettings { 'AUTH_REALM' } = '' ;
240 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
241 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
242 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
243 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
244 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
245 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
246 $proxysettings { 'NCSA_USERNAME' } = '' ;
247 $proxysettings { 'NCSA_GROUP' } = '' ;
248 $proxysettings { 'NCSA_PASS' } = '' ;
249 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
250 $proxysettings { 'LDAP_BASEDN' } = '' ;
251 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
252 $proxysettings { 'LDAP_SERVER' } = '' ;
253 $proxysettings { 'LDAP_PORT' } = '389' ;
254 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
255 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
256 $proxysettings { 'LDAP_GROUP' } = '' ;
257 $proxysettings { 'NTLM_DOMAIN' } = '' ;
258 $proxysettings { 'NTLM_PDC' } = '' ;
259 $proxysettings { 'NTLM_BDC' } = '' ;
260 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
261 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
262 $proxysettings { 'RADIUS_SERVER' } = '' ;
263 $proxysettings { 'RADIUS_PORT' } = '1812' ;
264 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
265 $proxysettings { 'RADIUS_SECRET' } = '' ;
266 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
267 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
268 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
269 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
270 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
271 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
272 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
273 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
274 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
275 $proxysettings { 'CHILDREN' } = '5' ;
277 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
279 & Header
:: getcgihash
( \
%proxysettings );
281 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
282 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
283 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
284 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
286 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
288 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
291 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
293 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
294 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
295 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
297 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
298 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
300 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
301 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
303 if (! $errormessage ) {
304 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
305 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
307 $proxysettings { 'NCSA_USERNAME' } = '' ;
308 $proxysettings { 'NCSA_GROUP' } = '' ;
309 $proxysettings { 'NCSA_PASS' } = '' ;
310 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
313 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
315 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
316 & deluser
( $proxysettings { 'ID' });
319 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
320 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
321 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
323 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
325 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
326 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
327 @temp = split ( /:/ , $proxysettings { 'ID' });
328 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
329 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
330 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
331 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
334 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }))
336 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
337 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
338 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
339 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
340 $errormessage = $Lang :: tr
{ 'invalid input' };
343 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
345 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
348 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
349 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
351 if (!( $proxysettings { 'CACHE_SIZE' } eq '0' ))
353 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
357 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
358 ( $proxysettings { 'CACHE_MEM' } < 1 ))
360 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
363 my @free = `/usr/bin/free` ;
364 $free [ 1 ] =~ m/(\d+)/ ;
365 $cachemem = int $1 / 2048 ;
366 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
367 $proxysettings { 'CACHE_MEM' } = $cachemem ;
369 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
371 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
374 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
376 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
379 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
381 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
384 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
386 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
389 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
391 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
394 if (!( $proxysettings { 'CHILDREN' } =~ /^\d+$/ ) || ( $proxysettings { 'CHILDREN' } < 1 ))
396 $errormessage = $Lang :: tr
{ 'advproxy invalid num of children' };
399 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
401 $browser_regexp = '' ;
402 foreach ( @useragentlist )
405 @useragent = split ( /,/ );
406 if ( $proxysettings { 'UA_' . $useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " $useragent [2]|" ; }
408 chop ( $browser_regexp );
409 if (! $browser_regexp )
411 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
415 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
417 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
418 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
419 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
421 if ( $netsettings { 'BLUE_DEV' })
423 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
424 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
426 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
430 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
432 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
437 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
438 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
440 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
443 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
445 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
448 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
450 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
453 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
455 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
458 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
460 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
464 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
466 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
468 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
472 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
474 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
476 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
480 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
482 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
484 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
487 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
489 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
492 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
494 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
497 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
499 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
501 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
506 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
508 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
510 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
513 if ( $proxysettings { 'NTLM_PDC' } eq '' )
515 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
518 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
520 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
523 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
525 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
529 $proxysettings { 'NTLM_DOMAIN' } = lc ( $proxysettings { 'NTLM_DOMAIN' });
530 $proxysettings { 'NTLM_PDC' } = lc ( $proxysettings { 'NTLM_PDC' });
531 $proxysettings { 'NTLM_BDC' } = lc ( $proxysettings { 'NTLM_BDC' });
533 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
535 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
537 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
540 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
542 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
545 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
547 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
552 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
555 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
556 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
557 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
558 if (( $proxy1 ne $proxy2 ))
560 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
568 $proxysettings { 'VALID' } = 'no' ; }
570 $proxysettings { 'VALID' } = 'yes' ; }
572 if ( $proxysettings { 'VALID' } eq 'yes' )
576 delete $proxysettings { 'SRC_SUBNETS' };
577 delete $proxysettings { 'SRC_BANNED_IP' };
578 delete $proxysettings { 'SRC_BANNED_MAC' };
579 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
580 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
581 delete $proxysettings { 'DST_NOCACHE' };
582 delete $proxysettings { 'DST_NOAUTH' };
583 delete $proxysettings { 'PORTS_SAFE' };
584 delete $proxysettings { 'PORTS_SSL' };
585 delete $proxysettings { 'MIME_TYPES' };
586 delete $proxysettings { 'NTLM_ALLOW_USERS' };
587 delete $proxysettings { 'NTLM_DENY_USERS' };
588 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
589 delete $proxysettings { 'RADIUS_DENY_USERS' };
590 delete $proxysettings { 'IDENT_HOSTS' };
591 delete $proxysettings { 'IDENT_ALLOW_USERS' };
592 delete $proxysettings { 'IDENT_DENY_USERS' };
594 delete $proxysettings { 'CRE_GROUPS' };
595 delete $proxysettings { 'CRE_SVHOSTS' };
597 delete $proxysettings { 'NCSA_USERNAME' };
598 delete $proxysettings { 'NCSA_GROUP' };
599 delete $proxysettings { 'NCSA_PASS' };
600 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
602 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
603 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
604 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
605 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
606 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
607 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
608 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
610 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
611 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
613 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
615 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
616 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
617 $stdproxysettings { 'UPSTREAM_PROXY' } = $proxysettings { 'UPSTREAM_PROXY' };
618 $stdproxysettings { 'UPSTREAM_USER' } = $proxysettings { 'UPSTREAM_USER' };
619 $stdproxysettings { 'UPSTREAM_PASSWORD' } = $proxysettings { 'UPSTREAM_PASSWORD' };
620 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
621 $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' };
622 $stdproxysettings { 'ENABLE_CLAMAV' } = $proxysettings { 'ENABLE_CLAMAV' };
623 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
628 system ( '/usr/local/bin/squidctrl' , 'disable' );
629 unlink "${General::swroot}/proxy/enable" ;
630 unlink "${General::swroot}/proxy/transparent" ;
631 unlink "${General::swroot}/proxy/enable_blue" ;
632 unlink "${General::swroot}/proxy/transparent_blue" ;
634 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
635 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable" );
636 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
637 if ( $proxysettings { 'TRANSPARENT' } eq 'on' && $proxysettings { 'ENABLE' } eq 'on' ) {
638 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent" ); }
639 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
640 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable_blue" );
641 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
642 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
643 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
645 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/squidctrl restart >/dev/null 2>&1' ); }
649 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
651 system ( '/usr/local/bin/squidctrl flush >/dev/null 2>&1' );
656 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
657 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
658 } elsif (- e
"${General::swroot}/proxy/settings" ) {
659 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
664 $checked { 'ENABLE' }{ 'off' } = '' ;
665 $checked { 'ENABLE' }{ 'on' } = '' ;
666 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
668 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
669 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
670 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
672 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
673 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
674 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
676 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
677 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
678 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
680 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
681 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
682 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
684 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
685 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
686 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
687 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
688 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
689 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
690 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
691 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
692 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
693 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
694 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
695 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
697 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
698 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
699 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
700 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
701 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
702 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
704 $checked { 'LOGGING' }{ 'off' } = '' ;
705 $checked { 'LOGGING' }{ 'on' } = '' ;
706 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
707 $checked { 'LOGQUERY' }{ 'off' } = '' ;
708 $checked { 'LOGQUERY' }{ 'on' } = '' ;
709 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
710 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
711 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
712 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
714 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
715 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
717 $checked { 'NO_PROXY_LOCAL' }{ 'off' } = '' ;
718 $checked { 'NO_PROXY_LOCAL' }{ 'on' } = '' ;
719 $checked { 'NO_PROXY_LOCAL' }{ $proxysettings { 'NO_PROXY_LOCAL' }} = "checked='checked'" ;
720 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'off' } = '' ;
721 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'on' } = '' ;
722 $checked { 'NO_PROXY_LOCAL_BLUE' }{ $proxysettings { 'NO_PROXY_LOCAL_BLUE' }} = "checked='checked'" ;
724 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
725 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
726 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
728 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
729 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
730 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
731 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
732 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
734 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
735 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
736 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
737 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
738 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
739 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
740 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
742 $checked { 'TIME_MON' }{ 'off' } = '' ;
743 $checked { 'TIME_MON' }{ 'on' } = '' ;
744 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
745 $checked { 'TIME_TUE' }{ 'off' } = '' ;
746 $checked { 'TIME_TUE' }{ 'on' } = '' ;
747 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
748 $checked { 'TIME_WED' }{ 'off' } = '' ;
749 $checked { 'TIME_WED' }{ 'on' } = '' ;
750 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
751 $checked { 'TIME_THU' }{ 'off' } = '' ;
752 $checked { 'TIME_THU' }{ 'on' } = '' ;
753 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
754 $checked { 'TIME_FRI' }{ 'off' } = '' ;
755 $checked { 'TIME_FRI' }{ 'on' } = '' ;
756 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
757 $checked { 'TIME_SAT' }{ 'off' } = '' ;
758 $checked { 'TIME_SAT' }{ 'on' } = '' ;
759 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
760 $checked { 'TIME_SUN' }{ 'off' } = '' ;
761 $checked { 'TIME_SUN' }{ 'on' } = '' ;
762 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
764 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
765 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
766 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
767 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
769 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
770 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
771 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
772 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
773 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
774 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
775 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
776 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
777 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
779 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
780 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
781 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
783 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
784 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
785 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
787 foreach ( @useragentlist ) {
788 @useragent = split ( /,/ );
789 $checked { 'UA_' . $useragent [ 0 ]}{ 'off' } = '' ;
790 $checked { 'UA_' . $useragent [ 0 ]}{ 'on' } = '' ;
791 $checked { 'UA_' . $useragent [ 0 ]}{ $proxysettings { 'UA_' . $useragent [ 0 ]}} = "checked='checked'" ;
794 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
795 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
796 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
797 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
798 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
799 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
800 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
802 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
804 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
805 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
806 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
808 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
809 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
810 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
812 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
814 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
816 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
818 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
819 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
820 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
822 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
823 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
824 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
826 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
827 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
828 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
830 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
831 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
832 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
834 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
835 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
836 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
838 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
839 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
840 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
842 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
843 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
844 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
846 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
847 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
848 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
850 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
851 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
852 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
854 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
855 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
856 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
858 $checked { 'ENABLE_CLAMAV' }{ 'off' } = '' ;
859 $checked { 'ENABLE_CLAMAV' }{ 'on' } = '' ;
860 $checked { 'ENABLE_CLAMAV' }{ $proxysettings { 'ENABLE_CLAMAV' }} = "checked='checked'" ;
862 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
864 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
867 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
868 print "<font class='base'> $errormessage </font> \n " ;
872 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
874 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
875 $squidversion [ 0 ] =~ s/^\s+//g ;
876 $squidversion [ 0 ] =~ s/\s+$//g ;
878 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
881 # ===================================================================
883 # ===================================================================
885 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
887 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
889 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
894 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
897 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
898 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
899 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
900 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
903 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
904 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
905 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
906 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
911 if ( $netsettings { 'BLUE_DEV' }) {
912 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
913 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
915 print "<td colspan='2'> </td>" ;
918 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
919 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
924 if ( $netsettings { 'BLUE_DEV' }) {
925 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
926 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
928 print "<td colspan='2'> </td>" ;
931 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
933 <select name='ERR_LANGUAGE'>
936 foreach (< $errordir /*>) {
938 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
939 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
947 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
948 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
949 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
950 <td class='base'><select name='ERR_DESIGN'>
951 <option value='ipfire' $selected {'ERR_DESIGN'}{'ipfire'}>IPFire</option>
952 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
956 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
957 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
964 <tr><td class='base' colspan='4'><b> $Lang ::tr{'advproxy redirector children'}</b></td></tr>
965 <tr><td class='base' > $Lang ::tr{'processes'}<input type='text' name='CHILDREN' value=' $proxysettings {'CHILDREN'}' size='5' /></td>
968 my $count = `arp -a | wc -l` ;
969 if ( $count < 1 ){ $count = 1 ;}
970 if ( - e
"/usr/bin/squidclamav" ) {
971 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy squidclamav' }. "</b><br />" ;
972 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_CLAMAV' ".$checked{'ENABLE_CLAMAV'}{'on'} . " /><br />" ;
973 print "+ " . int ( sqrt ( $count ) * 8 );
978 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy url filter' }. "</b><br />" ;
979 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'} . " /><br />" ;
980 print "+ " . int ( sqrt ( $count ) * 6 );
982 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy update accelerator' }. "</b><br />" ;
983 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'} . " /><br />" ;
984 print "+ " . int ( sqrt ( $count ) * 6 );
991 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
994 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}:</td>
995 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
996 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'} <img src='/blob.gif' alt='*' /></td>
997 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
1000 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td>
1001 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
1002 <td class='base'> $Lang ::tr{'advproxy upstream username'}: <img src='/blob.gif' alt='*' /></td>
1003 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
1006 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td>
1007 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
1008 <td class='base'> $Lang ::tr{'advproxy upstream password'}: <img src='/blob.gif' alt='*' /></td>
1009 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
1012 <td class='base'> $Lang ::tr{'advproxy no connection auth'}:</td>
1013 <td><input type='checkbox' name='NO_CONNECTION_AUTH' $checked {'NO_CONNECTION_AUTH'}{'on'} /></td>
1019 <table width='100%'>
1021 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
1024 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
1025 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
1026 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
1027 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
1032 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
1033 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
1037 <table width='100%'>
1039 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
1042 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1045 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
1046 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
1047 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
1048 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
1051 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
1052 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
1053 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
1054 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
1057 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
1058 <td class='base'><select name='L1_DIRS'>
1059 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
1060 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
1061 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
1062 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
1063 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
1065 <td colspan='2' rowspan= '5' valign='top' class='base'>
1066 <table cellspacing='0' cellpadding='0'>
1068 <!-- intentionally left empty -->
1071 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
1074 <!-- intentionally left empty -->
1077 <!-- intentionally left empty -->
1080 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1084 print $proxysettings { 'DST_NOCACHE' };
1093 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1094 <td class='base'><select name='MEM_POLICY'>
1095 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1096 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1097 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1098 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1102 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1103 <td class='base'><select name='CACHE_POLICY'>
1104 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1105 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1106 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1107 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1111 <td colspan='2'> </td>
1114 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1115 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1119 <table width='100%'>
1121 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1124 <td width='25%' align=center></td> <td width='20%' align=center></td><td width='25%' align=center></td><td width='30%' align=center></td>
1127 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}:</td>
1128 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}:</td>
1131 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1134 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1138 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1141 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1148 <table width='100%'>
1150 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1153 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1156 <td colspan='4' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1159 <td colspan='2' rowspan='4'><textarea name='SRC_SUBNETS' cols='32' rows='3' wrap='off'>
1163 if (! $proxysettings { 'SRC_SUBNETS' })
1165 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1166 if ( $netsettings { 'BLUE_DEV' })
1168 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1170 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1177 $line = $Lang :: tr
{ 'advproxy no internal proxy on green' };
1178 $line =~ s/Green/<font color="$Header::colourgreen">Green<\/ font
>/ i
;
1179 print "<td class='base'> $line :</td> \n " ;
1181 <td><input type='checkbox' name='NO_PROXY_LOCAL' $checked {'NO_PROXY_LOCAL'}{'on'} /></td>
1185 if ( $netsettings { 'BLUE_DEV' }) {
1186 $line = $Lang :: tr
{ 'advproxy no internal proxy on blue' };
1187 $line =~ s/Blue/<font color="$Header::colourblue">Blue<\/ font
>/ i
;
1189 print "<td class='base'> $line :</td> \n " ;
1191 <td><input type='checkbox' name='NO_PROXY_LOCAL_BLUE' $checked {'NO_PROXY_LOCAL_BLUE'}{'on'} /></td>
1198 <td colspan='2'> </td>
1201 <td colspan='2'> </td>
1204 <table width='100%'>
1206 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1209 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1210 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1213 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='3' wrap='off'>
1217 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1221 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='3' wrap='off'>
1225 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1231 <table width='100%'>
1233 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1236 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1237 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1240 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='3' wrap='off'>
1244 print $proxysettings { 'SRC_BANNED_IP' };
1248 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='3' wrap='off'>
1252 print $proxysettings { 'SRC_BANNED_MAC' };
1263 # -------------------------------------------------------------------
1264 # CRE GUI - optional
1265 # -------------------------------------------------------------------
1267 if (- e
$cre_enabled ) { print <<END
1268 <table width='100%'>
1271 <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>
1274 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1280 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1282 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1283 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1286 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1287 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1292 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1295 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1299 print $proxysettings { 'CRE_GROUPS' };
1303 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1306 print $proxysettings { 'CRE_SVHOSTS' };
1314 print "</table><hr size='1'>" ;
1318 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1319 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1320 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1325 # -------------------------------------------------------------------
1329 <table width='100%'>
1331 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1333 <table width='100%'>
1335 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1336 <td width='1%'> </td>
1337 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1338 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1339 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1340 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1341 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1342 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1343 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1344 <td width='1%'> </td>
1345 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1346 <td width='1%'> </td>
1347 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1352 <select name='TIME_ACCESS_MODE'>
1353 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1354 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1358 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1359 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1360 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1361 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1362 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1363 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1364 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1367 <select name='TIME_FROM_HOUR'>
1370 for ( $i = 0 ; $i <= 24 ; $i ++) {
1371 $_ = sprintf ( " %02s " , $i );
1372 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1379 <select name='TIME_FROM_MINUTE'>
1382 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1383 $_ = sprintf ( " %02s " , $i );
1384 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1391 <select name='TIME_TO_HOUR'>
1394 for ( $i = 0 ; $i <= 24 ; $i ++) {
1395 $_ = sprintf ( " %02s " , $i );
1396 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1403 <select name='TIME_TO_MINUTE'>
1406 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1407 $_ = sprintf ( " %02s " , $i );
1408 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1416 <table width='100%'>
1418 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1421 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1422 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1423 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1424 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1428 <table width='100%'>
1430 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1433 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1434 <td width='20%' class='base'>
1435 <select name='THROTTLING_GREEN_TOTAL'>
1439 foreach ( @throttle_limits ) {
1440 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1444 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1447 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1448 <td width='30%' class='base'>
1449 <select name='THROTTLING_GREEN_HOST'>
1453 foreach ( @throttle_limits ) {
1454 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1458 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1465 if ( $netsettings { 'BLUE_DEV' }) {
1468 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1470 <select name='THROTTLING_BLUE_TOTAL'>
1474 foreach ( @throttle_limits ) {
1475 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1479 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1482 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1484 <select name='THROTTLING_BLUE_HOST'>
1488 foreach ( @throttle_limits ) {
1489 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1493 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1503 <table width='100%'>
1505 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1508 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1509 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1510 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1511 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1512 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1513 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1514 <td width='15%'> </td>
1515 <td width='10%'> </td>
1519 <table width='100%'>
1521 <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>
1525 if ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' ){
1528 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1533 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1537 print $proxysettings { 'MIME_TYPES' };
1551 <table width='100%'>
1553 <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>
1557 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ){
1563 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1568 <table width='100%'>
1572 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1573 for ( $i = 0 ; $i <= 3 ; $i ++) {
1574 if ( $i eq 0 ) { print "<tr> \n " ; }
1575 if (( $n + $i ) < @useragentlist ) {
1576 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1577 print "<td width='15%'> $useragent [1]:<\/td> \n " ;
1578 print "<td width='10%'><input type='checkbox' name='UA_ $useragent [0]' $checked {'UA_'. $useragent [0]}{'on'} /></td> \n " ;
1580 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1587 <table width='100%'>
1589 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1592 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1593 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1596 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='56' /></td>
1597 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='56' /></td>
1605 <table width='100%'>
1607 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1610 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1611 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1612 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1613 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1614 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1615 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1621 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1623 <table width='100%'>
1625 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1628 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1631 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1632 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1633 <td colspan='2' rowspan= '6' valign='top' class='base'>
1634 <table cellpadding='0' cellspacing='0'>
1636 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1639 <!-- intentionally left empty -->
1642 <!-- intentionally left empty -->
1645 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1648 <!-- intentionally left empty -->
1651 <!-- intentionally left empty -->
1654 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1657 <!-- intentionally left empty -->
1660 <!-- intentionally left empty -->
1663 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1667 print $proxysettings { 'DST_NOAUTH' };
1676 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1677 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1680 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1681 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1684 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1685 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1688 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1689 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1692 <td colspan='2'> </td>
1699 # ===================================================================
1700 # NCSA auth settings
1701 # ===================================================================
1703 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1706 <table width='100%'>
1708 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1711 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1712 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1713 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1714 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1717 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1725 # ===================================================================
1726 # IDENTD auth settings
1727 # ===================================================================
1729 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1732 <table width='100%'>
1734 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1737 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1738 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1739 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1740 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1743 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1744 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1749 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1750 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1753 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1756 if (! $proxysettings { 'IDENT_HOSTS' }) {
1757 print " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
1758 if ( $netsettings { 'BLUE_DEV' }) {
1759 print " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
1762 print $proxysettings { 'IDENT_HOSTS' };
1767 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1771 print $proxysettings { 'DST_NOAUTH' };
1778 <table width='100%'>
1780 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1783 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1784 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1785 <td width='25%'> </td>
1786 <td width='30%'> </td>
1789 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1790 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1791 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1792 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1795 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1796 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1799 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1803 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1805 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1807 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1811 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1813 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1820 # ===================================================================
1821 # NTLM auth settings
1822 # ===================================================================
1824 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1827 <table width='100%'>
1829 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1832 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1833 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1834 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1835 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1836 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1837 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1841 <table width='100%'>
1843 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1846 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1847 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1852 <table width='100%'>
1854 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1857 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1858 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1859 <td width='25%'> </td>
1860 <td width='30%'> </td>
1863 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1864 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1865 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1866 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1869 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1870 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1873 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1877 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1879 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1881 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1885 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1887 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1894 # ===================================================================
1895 # LDAP auth settings
1896 # ===================================================================
1898 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1901 <table width='100%'>
1903 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1906 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1907 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1908 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1909 <td class='base'><select name='LDAP_TYPE'>
1910 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1911 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1912 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1913 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
1917 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
1918 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
1919 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
1920 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
1924 <table width='100%'>
1926 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
1929 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
1930 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
1931 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
1932 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
1936 <table width='100%'>
1938 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
1941 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
1942 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
1950 # ===================================================================
1951 # RADIUS auth settings
1952 # ===================================================================
1954 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
1957 <table width='100%'>
1959 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
1962 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
1963 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
1964 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
1965 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
1968 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
1969 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
1970 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
1971 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
1975 <table width='100%'>
1977 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
1980 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1981 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
1982 <td width='25%'> </td>
1983 <td width='30%'> </td>
1986 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
1987 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
1988 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
1989 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
1992 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
1993 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
1996 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
2000 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
2002 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
2004 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
2008 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
2010 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
2017 # ===================================================================
2023 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
2025 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2026 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2027 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2028 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
2029 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
2030 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2031 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
2035 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
2037 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2038 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2039 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2040 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
2041 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2045 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
2047 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2048 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
2052 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
2054 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
2055 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
2056 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
2057 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
2058 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
2059 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
2060 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
2064 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2066 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2067 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2068 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2069 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2070 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2071 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2072 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2076 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
2078 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
2079 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
2080 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
2081 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
2082 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
2083 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
2084 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
2085 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
2089 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2091 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2092 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2093 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2094 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2095 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2096 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2097 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2098 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2110 <table width='100%'>
2113 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2114 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2115 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2121 <table width='100%'>
2123 <td><img src='/blob.gif' align='top' alt='*' />
2124 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2126 <td align='right'> </td>
2133 & Header
:: closebox
();
2137 # ===================================================================
2138 # NCSA user management
2139 # ===================================================================
2141 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2143 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2144 <table width='100%'>
2146 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2149 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2150 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2153 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly " ; }
2156 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2158 <select name='NCSA_GROUP'>
2159 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2160 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2161 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2167 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2168 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2169 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2170 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2177 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2178 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2179 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2182 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2183 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2189 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2194 <table width='100%'>
2196 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2199 <table width='100%' align='center'>
2205 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2206 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2210 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2211 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2215 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2216 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2219 @userlist = sort ( @userlist );
2221 # If the password file contains entries, print entries and action icons
2223 if ( ! - z
" $userdb " ) {
2226 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2227 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2228 <td class='boldbase' colspan='2' align='center'> </td>
2233 foreach $line ( @userlist )
2237 @temp = split ( /:/ , $line );
2238 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2239 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2241 print "<tr bgcolor=' $color {'color20'}'> \n " ; }
2243 print "<tr bgcolor=' $color {'color22'}'> \n " ; }
2246 <td align='center'> $temp [0]</td>
2250 if ( $temp [ 1 ] eq 'standard' ) {
2251 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2252 } elsif ( $temp [ 1 ] eq 'extended' ) {
2253 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2254 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2255 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2258 <td width='8%' align='center'>
2259 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2260 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2261 <input type='hidden' name='ID' value=' $line ' />
2262 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2266 <td width='8%' align='center'>
2267 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2268 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2269 <input type='hidden' name='ID' value=' $temp [0]' />
2270 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2283 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2284 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2285 <td class='base'> $Lang ::tr{'edit'}</td>
2286 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2287 <td class='base'> $Lang ::tr{'remove'}</td>
2294 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2305 & Header
:: closebox
();
2309 # ===================================================================
2311 & Header
:: closebigbox
();
2313 & Header
:: closepage
();
2315 # -------------------------------------------------------------------
2319 if (- e
" $acl_src_subnets " ) {
2320 open ( FILE
, " $acl_src_subnets " );
2321 delete $proxysettings { 'SRC_SUBNETS' };
2322 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2325 if (- e
" $acl_src_banned_ip " ) {
2326 open ( FILE
, " $acl_src_banned_ip " );
2327 delete $proxysettings { 'SRC_BANNED_IP' };
2328 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2331 if (- e
" $acl_src_banned_mac " ) {
2332 open ( FILE
, " $acl_src_banned_mac " );
2333 delete $proxysettings { 'SRC_BANNED_MAC' };
2334 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2337 if (- e
" $acl_src_unrestricted_ip " ) {
2338 open ( FILE
, " $acl_src_unrestricted_ip " );
2339 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2340 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2343 if (- e
" $acl_src_unrestricted_mac " ) {
2344 open ( FILE
, " $acl_src_unrestricted_mac " );
2345 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2346 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2349 if (- e
" $acl_dst_nocache " ) {
2350 open ( FILE
, " $acl_dst_nocache " );
2351 delete $proxysettings { 'DST_NOCACHE' };
2352 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2355 if (- e
" $acl_dst_noauth " ) {
2356 open ( FILE
, " $acl_dst_noauth " );
2357 delete $proxysettings { 'DST_NOAUTH' };
2358 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2361 if (- e
" $acl_ports_safe " ) {
2362 open ( FILE
, " $acl_ports_safe " );
2363 delete $proxysettings { 'PORTS_SAFE' };
2364 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2367 if (- e
" $acl_ports_ssl " ) {
2368 open ( FILE
, " $acl_ports_ssl " );
2369 delete $proxysettings { 'PORTS_SSL' };
2370 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2373 if (- e
" $mimetypes " ) {
2374 open ( FILE
, " $mimetypes " );
2375 delete $proxysettings { 'MIME_TYPES' };
2376 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2379 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2380 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2381 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2382 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2385 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2386 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2387 delete $proxysettings { 'NTLM_DENY_USERS' };
2388 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2391 if (- e
" $raddir /radauth.allowusers" ) {
2392 open ( FILE
, " $raddir /radauth.allowusers" );
2393 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2394 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2397 if (- e
" $raddir /radauth.denyusers" ) {
2398 open ( FILE
, " $raddir /radauth.denyusers" );
2399 delete $proxysettings { 'RADIUS_DENY_USERS' };
2400 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2403 if (- e
" $identdir /identauth.allowusers" ) {
2404 open ( FILE
, " $identdir /identauth.allowusers" );
2405 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2406 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2409 if (- e
" $identdir /identauth.denyusers" ) {
2410 open ( FILE
, " $identdir /identauth.denyusers" );
2411 delete $proxysettings { 'IDENT_DENY_USERS' };
2412 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2415 if (- e
" $identhosts " ) {
2416 open ( FILE
, " $identhosts " );
2417 delete $proxysettings { 'IDENT_HOSTS' };
2418 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2421 if (- e
" $cre_groups " ) {
2422 open ( FILE
, " $cre_groups " );
2423 delete $proxysettings { 'CRE_GROUPS' };
2424 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2427 if (- e
" $cre_svhosts " ) {
2428 open ( FILE
, " $cre_svhosts " );
2429 delete $proxysettings { 'CRE_SVHOSTS' };
2430 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2435 # -------------------------------------------------------------------
2439 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2440 undef $proxysettings { 'PORTS_SAFE' };
2443 s/^\s+//g ; s/\s+$//g ;
2447 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2449 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2450 @templist = split ( /-/ );
2451 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2452 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2456 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2457 undef $proxysettings { 'PORTS_SSL' };
2460 s/^\s+//g ; s/\s+$//g ;
2465 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2466 @templist = split ( /-/ );
2467 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2468 $proxysettings { 'PORTS_SSL' } .= $line . " \n " ;
2472 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2473 undef $proxysettings { 'DST_NOCACHE' };
2477 unless ( /^#/ ) { s/\s+//g ; }
2480 if ( /^\./ ) { $_ = '*' . $_ ; }
2481 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2485 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2486 undef $proxysettings { 'SRC_SUBNETS' };
2489 s/^\s+//g ; s/\s+$//g ;
2492 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2493 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2497 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2498 undef $proxysettings { 'SRC_BANNED_IP' };
2501 s/^\s+//g ; s/\s+$//g ;
2504 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2505 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2509 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2510 undef $proxysettings { 'SRC_BANNED_MAC' };
2513 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2516 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2517 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2521 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2522 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2525 s/^\s+//g ; s/\s+$//g ;
2528 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2529 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2533 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2534 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2537 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2540 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2541 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2545 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2549 unless ( /^#/ ) { s/\s+//g ; }
2552 if ( /^\./ ) { $_ = '*' . $_ ; }
2553 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2557 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2559 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2560 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2563 s/^\s+//g ; s/\s+$//g ;
2564 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2566 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2569 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2571 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2572 undef $proxysettings { 'NTLM_DENY_USERS' };
2575 s/^\s+//g ; s/\s+$//g ;
2576 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2578 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2581 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2583 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2584 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2587 s/^\s+//g ; s/\s+$//g ;
2588 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2590 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2593 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2595 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2596 undef $proxysettings { 'IDENT_DENY_USERS' };
2599 s/^\s+//g ; s/\s+$//g ;
2600 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2602 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2605 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2607 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2608 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2611 s/^\s+//g ; s/\s+$//g ;
2612 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2614 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2617 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2619 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2620 undef $proxysettings { 'RADIUS_DENY_USERS' };
2623 s/^\s+//g ; s/\s+$//g ;
2624 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2626 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2629 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2630 undef $proxysettings { 'IDENT_HOSTS' };
2633 s/^\s+//g ; s/\s+$//g ;
2636 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2637 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2641 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2642 undef $proxysettings { 'CRE_SVHOSTS' };
2645 s/^\s+//g ; s/\s+$//g ;
2648 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2649 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2654 # -------------------------------------------------------------------
2658 open ( FILE
, "> $acl_src_subnets " );
2660 if (! $proxysettings { 'SRC_SUBNETS' })
2662 print FILE
" $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'} \n " ;
2663 if ( $netsettings { 'BLUE_DEV' })
2665 print FILE
" $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'} \n " ;
2667 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2670 open ( FILE
, "> $acl_src_banned_ip " );
2672 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2675 open ( FILE
, "> $acl_src_banned_mac " );
2677 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2680 open ( FILE
, "> $acl_src_unrestricted_ip " );
2682 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2685 open ( FILE
, "> $acl_src_unrestricted_mac " );
2687 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2690 open ( FILE
, "> $acl_dst_noauth " );
2692 print FILE
$proxysettings { 'DST_NOAUTH' };
2695 open ( FILE
, "> $acl_dst_noauth_net " );
2697 open ( FILE
, "> $acl_dst_noauth_dom " );
2699 open ( FILE
, "> $acl_dst_noauth_url " );
2702 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2710 open ( FILE
, ">> $acl_dst_noauth_dom " );
2715 elsif (& General
:: validipormask
( $_ ))
2717 open ( FILE
, ">> $acl_dst_noauth_net " );
2722 elsif ( /\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?-\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/ )
2724 open ( FILE
, ">> $acl_dst_noauth_net " );
2731 open ( FILE
, ">> $acl_dst_noauth_url " );
2733 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2739 open ( FILE
, "> $acl_dst_nocache " );
2741 print FILE
$proxysettings { 'DST_NOCACHE' };
2744 open ( FILE
, "> $acl_dst_nocache_net " );
2746 open ( FILE
, "> $acl_dst_nocache_dom " );
2748 open ( FILE
, "> $acl_dst_nocache_url " );
2751 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2759 open ( FILE
, ">> $acl_dst_nocache_dom " );
2764 elsif (& General
:: validipormask
( $_ ))
2766 open ( FILE
, ">> $acl_dst_nocache_net " );
2771 elsif ( /\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?-\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?/ )
2773 open ( FILE
, ">> $acl_dst_nocache_net " );
2780 open ( FILE
, ">> $acl_dst_nocache_url " );
2782 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2788 open ( FILE
, "> $acl_ports_safe " );
2790 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2793 open ( FILE
, "> $acl_ports_ssl " );
2795 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2798 open ( FILE
, "> $acl_dst_throttle " );
2800 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2802 @temp = split ( /\|/ , $throttle_binary );
2803 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2805 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2807 @temp = split ( /\|/ , $throttle_dskimg );
2808 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2810 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2812 @temp = split ( /\|/ , $throttle_mmedia );
2813 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2815 if (- s
$throttled_urls )
2817 open ( URLFILE
, $throttled_urls );
2820 foreach ( @temp ) { print FILE
; }
2824 open ( FILE
, "> $mimetypes " );
2826 print FILE
$proxysettings { 'MIME_TYPES' };
2829 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2831 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2834 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2836 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2839 open ( FILE
, "> $raddir /radauth.allowusers" );
2841 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2844 open ( FILE
, "> $raddir /radauth.denyusers" );
2846 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2849 open ( FILE
, "> $identdir /identauth.allowusers" );
2851 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2854 open ( FILE
, "> $identdir /identauth.denyusers" );
2856 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2859 open ( FILE
, "> $identhosts " );
2861 print FILE
$proxysettings { 'IDENT_HOSTS' };
2864 open ( FILE
, "> $cre_groups " );
2866 print FILE
$proxysettings { 'CRE_GROUPS' };
2869 open ( FILE
, "> $cre_svhosts " );
2871 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2875 # -------------------------------------------------------------------
2879 open ( FILE
, ">/srv/web/ipfire/html/proxy.pac" );
2881 print FILE
"function FindProxyForURL(url, host) \n " ;
2883 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2887 (isPlainHostName(host)) ||
2888 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2889 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2890 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2891 (isInNet(host, "192.168.0.0", "255.255.0.0")) ||
2892 (isInNet(host, "169.254.0.0", "255.255.0.0"))
2900 if ( $proxysettings { 'ENABLE' } eq 'on' )
2902 print FILE
"if ( \n " ;
2903 print FILE
" (isInNet(myIpAddress(), \" $netsettings {'GREEN_NETADDRESS'} \" , \" $netsettings {'GREEN_NETMASK'} \" ))" ;
2906 if (- e
" $acl_src_subnets " ) {
2907 open ( SUBNETS
, " $acl_src_subnets " );
2908 @templist = < SUBNETS
>;
2914 @temp = split ( /\/ /);
2916 ( $temp [ 0 ] ne $netsettings { 'GREEN_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'GREEN_NETMASK' }) &&
2917 ( $temp [ 0 ] ne $netsettings { 'BLUE_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'BLUE_NETMASK' })
2921 print FILE
" || \n (isInNet(myIpAddress(), \" $temp [0] \" , \" $temp [1] \" ))" ;
2931 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2935 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
2937 print FILE
" \n else \n\n " ;
2939 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2943 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
2945 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
2954 # -------------------------------------------------------------------
2961 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
2962 $proxysettings { 'THROTTLING_GREEN_HOST' } +
2963 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
2964 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
2966 $delaypools = 1 ; } else { $delaypools = 0 ;
2969 if ( $proxysettings { 'AUTH_REALM' } eq '' )
2971 $authrealm = "IPFire Advanced Proxy Server" ;
2973 $authrealm = $proxysettings { 'AUTH_REALM' };
2976 $_ = $proxysettings { 'UPSTREAM_PROXY' };
2977 my ( $remotehost , $remoteport ) = ( /^(?:[a-zA-Z ]+\:\/ \
/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/ .* ?
) ?
$/);
2979 if ( $remoteport eq '' ) { $remoteport = 80 ; }
2981 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
2984 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
2985 # you make will be overwritten whenever you resave proxy settings using the
2988 # Instead, modify the file ' $acl_include ' and
2989 # then restart the proxy service using the web interface. Changes made to the
2990 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
2992 shutdown_lifetime 5 seconds
2997 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
2998 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) { print FILE
" transparent" }
2999 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3002 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3003 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
3004 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) { print FILE
" transparent" }
3005 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3009 if ( $proxysettings { 'CACHE_SIZE' } > 0 )
3013 if (!- z
$acl_dst_nocache_dom ) {
3014 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache_dom \"\n " ;
3015 print FILE
"cache deny no_cache_domains \n " ;
3017 if (!- z
$acl_dst_nocache_net ) {
3018 print FILE
"acl no_cache_domains dst \" $acl_dst_nocache_net \"\n " ;
3019 print FILE
"cache deny no_cache_ipaddr \n " ;
3021 if (!- z
$acl_dst_nocache_url ) {
3022 print FILE
"acl no_cache_hosts url_regex -i \" $acl_dst_nocache_url \"\n " ;
3023 print FILE
"cache deny no_cache_hosts \n " ;
3029 cache_effective_user squid
3030 cache_effective_group squid
3033 pid_filename /var/run/squid.pid
3035 cache_mem $proxysettings {'CACHE_MEM'} MB
3039 if ( $proxysettings { 'CACHE_SIZE' } eq '0' )
3041 print FILE
"cache_dir null /var/tmp \n\n " ;
3043 print FILE
"cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256 \n\n " ;
3046 if (( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ))
3048 print FILE
"error_directory $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'} \n\n " ;
3050 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
3053 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
3055 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
3057 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
3059 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
3061 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
3063 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
3068 if ( $proxysettings { 'LOGGING' } eq 'on' )
3071 access_log /var/log/squid/access.log
3072 cache_log /var/log/squid/cache.log
3073 cache_store_log none
3076 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"useragent_log \/var\/log\/squid\/user_agent.log \n " ; }
3077 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
3080 access_log /dev/null
3082 cache_store_log none
3091 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
3093 print FILE
"forwarded_for on \n " ;
3095 print FILE
"forwarded_for off \n " ;
3097 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
3099 print FILE
"via on \n " ;
3101 print FILE
"via off \n " ;
3105 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3107 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3109 print FILE
"auth_param basic program $authdir /ncsa_auth $userdb \n " ;
3110 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3111 print FILE
"auth_param basic realm $authrealm \n " ;
3112 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3113 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3116 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
3118 print FILE
"auth_param basic program $authdir /squid_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
3119 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
3120 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
3121 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
3123 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3125 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
3127 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3129 print FILE
" -u sAMAccountName -P" ;
3131 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
3133 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3135 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
3137 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
3139 print FILE
" -u cn -P" ;
3141 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
3143 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3145 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
3147 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3149 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
3150 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
3151 print FILE
" -u uid -P" ;
3153 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
3154 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3155 print FILE
"auth_param basic realm $authrealm \n " ;
3156 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3157 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3160 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
3162 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
3164 print FILE
"auth_param ntlm program $authdir /ntlm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
3165 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
3166 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
3167 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3169 print FILE
"auth_param basic program $authdir /msnt_auth \n " ;
3170 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3171 print FILE
"auth_param basic realm $authrealm \n " ;
3172 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3173 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3175 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
3177 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
3178 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
3179 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
3180 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3182 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
3184 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
3186 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
3193 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3195 print FILE
"auth_param basic program $authdir /squid_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3196 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3197 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3198 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3199 print FILE
"auth_param basic realm $authrealm \n " ;
3200 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3201 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3205 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3206 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
3208 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
3210 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
3212 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
3214 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
3217 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3219 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3221 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3223 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3225 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3228 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3231 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3232 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3234 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3237 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3238 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3239 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3244 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3246 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3248 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3250 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3252 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3254 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3256 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3258 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3261 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3262 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3263 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3267 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3269 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
3271 print FILE
"acl within_timeframe time " ;
3272 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3273 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3274 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3275 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3276 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3277 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3278 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3279 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3280 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3281 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3282 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3284 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3285 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3289 acl all src 0.0.0.0/0.0.0.0
3290 acl localhost src 127.0.0.1/255.255.255.255
3293 open ( PORTS
, " $acl_ports_ssl " );
3298 foreach ( @temp ) { print FILE
"acl SSL_ports port $_ " ; }
3300 open ( PORTS
, " $acl_ports_safe " );
3305 foreach ( @temp ) { print FILE
"acl Safe_ports port $_ " ; }
3309 acl IPFire_http port $http_port
3310 acl IPFire_https port $https_port
3311 acl IPFire_ips dst $netsettings {'GREEN_ADDRESS'}
3312 acl IPFire_networks src " $acl_src_subnets "
3313 acl IPFire_servers dst " $acl_src_subnets "
3314 acl IPFire_green_network src $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3315 acl IPFire_green_servers dst $netsettings {'GREEN_NETADDRESS'}/ $netsettings {'GREEN_NETMASK'}
3318 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_network src $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3319 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_servers dst $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'} \n " ; }
3320 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPFire_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3321 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPFire_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3322 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPFire_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3323 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPFire_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3325 acl CONNECT method CONNECT
3329 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3332 #Classroom extensions
3333 acl IPFire_no_access_ips src " $acl_src_noaccess_ip "
3334 acl IPFire_no_access_mac arp " $acl_src_noaccess_mac "
3337 print FILE
"deny_info " ;
3338 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3339 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3341 print FILE
"ERR_ACCESS_DISABLED" ;
3343 print FILE
"ERR_ACCESS_DENIED" ;
3345 print FILE
" IPFire_no_access_ips \n " ;
3346 print FILE
"deny_info " ;
3347 if ((( $proxysettings { 'ERR_DESIGN' } eq 'ipfire' ) && (- e
" $errordir .ipfire/ $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )) ||
3348 (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" )))
3350 print FILE
"ERR_ACCESS_DISABLED" ;
3352 print FILE
"ERR_ACCESS_DENIED" ;
3354 print FILE
" IPFire_no_access_mac \n " ;
3357 http_access deny IPFire_no_access_ips
3358 http_access deny IPFire_no_access_mac
3363 #Insert acl file and replace __VAR__ with correct values
3364 my $blue_net = '' ; #BLUE empty by default
3366 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3367 $blue_net = " $netsettings {'BLUE_NETADDRESS'}/ $netsettings {'BLUE_NETMASK'}" ;
3368 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3370 if (!- z
$acl_include )
3372 open ( ACL
, " $acl_include " );
3373 print FILE
" \n #Start of custom includes \n\n " ;
3375 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3376 $_ =~ s/__GREEN_NET__/$netsettings{'GREEN_NETADDRESS'}\/ $netsettings { 'GREEN_NETMASK' }/;
3377 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3378 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3379 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3382 print FILE
" \n #End of custom includes \n " ;
3385 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3389 #local machine, no restriction
3390 http_access allow localhost
3392 #GUI admin if local machine connects
3393 http_access allow IPFire_ips IPFire_networks IPFire_http
3394 http_access allow CONNECT IPFire_ips IPFire_networks IPFire_https
3396 #Deny not web services
3397 http_access deny !Safe_ports
3398 http_access deny CONNECT !SSL_ports
3403 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3405 print FILE
"#Set ident ACLs \n " ;
3406 if (!- z
$identhosts )
3408 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3409 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3410 print FILE
"ident_lookup_access deny all \n " ;
3412 print FILE
"ident_lookup_access allow all \n " ;
3414 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3418 print FILE
"#Set download throttling \n " ;
3420 if ( $netsettings { 'BLUE_DEV' })
3422 print FILE
"delay_pools 2 \n " ;
3424 print FILE
"delay_pools 1 \n " ;
3427 print FILE
"delay_class 1 3 \n " ;
3428 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3430 print FILE
"delay_parameters 1 " ;
3431 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3435 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3437 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3440 print FILE
" -1/-1 " ;
3441 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3445 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3447 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3451 if ( $netsettings { 'BLUE_DEV' })
3453 print FILE
"delay_parameters 2 " ;
3454 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3458 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3460 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3462 print FILE
" -1/-1 " ;
3463 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3467 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3469 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3474 print FILE
"delay_access 1 deny IPFire_ips \n " ;
3475 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPFire_unrestricted_ips \n " ; }
3476 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPFire_unrestricted_mac \n " ; }
3477 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3479 if ( $netsettings { 'BLUE_DEV' })
3481 print FILE
"delay_access 1 allow IPFire_green_network" ;
3482 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3484 print FILE
"delay_access 1 deny all \n " ;
3486 print FILE
"delay_access 1 allow all" ;
3487 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3491 if ( $netsettings { 'BLUE_DEV' })
3493 print FILE
"delay_access 2 deny IPFire_ips \n " ;
3494 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPFire_unrestricted_ips \n " ; }
3495 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPFire_unrestricted_mac \n " ; }
3496 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3497 print FILE
"delay_access 2 allow IPFire_blue_network" ;
3498 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3500 print FILE
"delay_access 2 deny all \n " ;
3503 print FILE
"delay_initial_bucket_level 100 \n " ;
3507 if ( $proxysettings { 'NO_PROXY_LOCAL' } eq 'on' )
3509 print FILE
"#Prevent internal proxy access to Green \n " ;
3510 print FILE
"http_access deny IPFire_green_servers !IPFire_green_network \n\n " ;
3513 if ( $proxysettings { 'NO_PROXY_LOCAL_BLUE' } eq 'on' )
3515 print FILE
"#Prevent internal proxy access from Blue \n " ;
3516 print FILE
"http_access allow IPFire_blue_network IPFire_blue_servers \n " ;
3517 print FILE
"http_access deny IPFire_blue_network IPFire_servers \n\n " ;
3521 #Set custom configured ACLs
3524 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPFire_banned_ips \n " ; }
3525 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPFire_banned_mac \n " ; }
3527 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3529 if (!- z
$acl_src_unrestricted_ip )
3531 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_ips to_ipaddr_without_auth \n " ; }
3532 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_ips to_domains_without_auth \n " ; }
3533 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_ips to_hosts_without_auth \n " ; }
3535 if (!- z
$acl_src_unrestricted_mac )
3537 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_mac to_ipaddr_without_auth \n " ; }
3538 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_mac to_domains_without_auth \n " ; }
3539 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_mac to_hosts_without_auth \n " ; }
3541 if (!- z
$acl_dst_noauth_net )
3543 print FILE
"http_access allow IPFire_networks" ;
3544 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3545 print FILE
" !within_timeframe" ;
3547 print FILE
" within_timeframe" ; }
3548 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3549 print FILE
" to_ipaddr_without_auth \n " ;
3551 if (!- z
$acl_dst_noauth_dom )
3553 print FILE
"http_access allow IPFire_networks" ;
3554 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3555 print FILE
" !within_timeframe" ;
3557 print FILE
" within_timeframe" ; }
3558 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3559 print FILE
" to_domains_without_auth \n " ;
3561 if (!- z
$acl_dst_noauth_url )
3563 print FILE
"http_access allow IPFire_networks" ;
3564 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3565 print FILE
" !within_timeframe" ;
3567 print FILE
" within_timeframe" ; }
3568 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3569 print FILE
" to_hosts_without_auth \n " ;
3573 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3575 print FILE
"http_access deny !for_inetusers" ;
3576 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3581 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3582 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3583 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3584 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3585 (!- z
" $identdir /identauth.denyusers" )
3588 print FILE
"http_access deny for_acl_users" ;
3589 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3593 if (!- z
$acl_src_unrestricted_ip )
3595 print FILE
"http_access allow IPFire_unrestricted_ips" ;
3596 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3598 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3600 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3602 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3604 print FILE
" for_inetusers" ;
3606 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3608 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3610 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3612 print FILE
" for_acl_users" ;
3614 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3616 print FILE
" !for_acl_users" ;
3618 } else { print FILE
" for_inetusers" ; }
3620 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3622 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3624 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3626 print FILE
" for_acl_users" ;
3628 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3630 print FILE
" !for_acl_users" ;
3632 } else { print FILE
" for_inetusers" ; }
3638 if (!- z
$acl_src_unrestricted_mac )
3640 print FILE
"http_access allow IPFire_unrestricted_mac" ;
3641 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3643 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3645 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3647 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3649 print FILE
" for_inetusers" ;
3651 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3653 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3655 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3657 print FILE
" for_acl_users" ;
3659 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3661 print FILE
" !for_acl_users" ;
3663 } else { print FILE
" for_inetusers" ; }
3665 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3667 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3669 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3671 print FILE
" for_acl_users" ;
3673 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3675 print FILE
" !for_acl_users" ;
3677 } else { print FILE
" for_inetusers" ; }
3683 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3685 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3686 if (!- z
$extgrp ) { print FILE
"http_access allow IPFire_networks for_extended_users \n " ; }
3691 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3692 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3693 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3694 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3695 (!- z
" $ntlmdir /msntauth.denyusers" )
3699 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3700 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3701 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3702 (!- z
" $raddir /radauth.denyusers" )
3706 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3707 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3708 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3709 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3710 (!- z
" $identdir /identauth.denyusers" )
3714 print FILE
"http_access deny for_acl_users" ;
3715 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3719 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3721 print FILE
"http_access allow" ;
3722 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3723 print FILE
" !within_timeframe" ;
3725 print FILE
" within_timeframe" ; }
3726 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3727 print FILE
" !on_ident_aware_hosts \n " ;
3730 print FILE
"http_access allow IPFire_networks" ;
3733 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3734 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3735 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3736 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3737 (!- z
" $ntlmdir /msntauth.allowusers" )
3741 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3742 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3743 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3744 (!- z
" $raddir /radauth.allowusers" )
3748 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3749 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3750 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3751 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3752 (!- z
" $identdir /identauth.allowusers" )
3756 print FILE
" for_acl_users" ;
3757 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3758 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3759 print FILE
" for_inetusers" ;
3761 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3763 print FILE
" !concurrent" ;
3765 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3766 print FILE
" !within_timeframe" ;
3768 print FILE
" within_timeframe" ; }
3769 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3772 print FILE
"http_access deny all \n\n " ;
3774 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3775 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3777 print FILE
"#Strip HTTP Header \n " ;
3779 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3781 print FILE
"header_access X-Forwarded-For deny all \n " ;
3783 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3785 print FILE
"header_access Via deny all \n " ;
3787 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3789 print FILE
"header_access User-Agent deny all \n " ;
3791 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3793 print FILE
"header_access Referer deny all \n " ;
3798 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3800 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3802 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3804 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3806 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3812 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3814 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3815 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPFire_unrestricted_ips \n " ; }
3816 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPFire_unrestricted_mac \n " ; }
3817 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3819 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3821 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3822 print FILE
"http_reply_access allow all \n\n " ;
3825 if ( $proxysettings { 'CACHE_SIZE' } > 0 )
3828 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3829 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3833 } else { print FILE
"cache deny all \n\n " ; }
3836 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3839 $replybodymaxsize = 1024 * $proxysettings { 'MAX_INCOMING_SIZE' };
3840 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3841 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size 0 allow IPFire_unrestricted_ips \n " ; }
3842 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size 0 allow IPFire_unrestricted_mac \n " ; }
3843 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3845 if (!- z
$extgrp ) { print FILE
"reply_body_max_size 0 allow for_extended_users \n " ; }
3848 print FILE
"reply_body_max_size $replybodymaxsize allow all \n\n " ;
3850 print FILE
"visible_hostname" ;
3851 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3853 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3855 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3858 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n\n " ; }
3860 # Write the parent proxy info, if needed.
3861 if ( $remotehost ne '' )
3863 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3865 # Enter authentication for the parent cache. Option format is
3866 # login=user:password ($proxy1='YES')
3867 # login=PASS ($proxy1='PASS')
3868 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3869 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3871 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3872 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3874 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3876 print FILE
" \n always_direct allow IPFire_ips \n " ;
3877 print FILE
"never_direct allow all \n\n " ;
3879 if (( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) || ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ) || ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ))
3881 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3882 print FILE
"url_rewrite_children $proxysettings {'CHILDREN'} \n\n " ;
3887 # -------------------------------------------------------------------
3891 my ( $str_user , $str_pass , $str_group ) = @_ ;
3892 my @groupmembers =();
3894 if ( $str_pass eq 'lEaVeAlOnE' )
3896 open ( FILE
, " $userdb " );
3897 @groupmembers = < FILE
>;
3899 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
3900 & deluser
( $str_user );
3901 open ( FILE
, ">> $userdb " );
3903 print FILE
" $str_user $str_pass " ;
3906 & deluser
( $str_user );
3907 system ( "/usr/sbin/htpasswd -b $userdb $str_user $str_pass " );
3910 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
3911 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
3912 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
3914 print FILE
" $str_user \n " ;
3920 # -------------------------------------------------------------------
3924 my ( $str_user ) = @_ ;
3926 my @groupmembers =();
3929 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
3932 open ( FILE
, " $groupfile " );
3933 @groupmembers = < FILE
>;
3935 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
3936 open ( FILE
, "> $groupfile " );
3938 print FILE
@templist ;
3943 open ( FILE
, " $userdb " );
3944 @groupmembers = < FILE
>;
3946 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
3947 open ( FILE
, "> $userdb " );
3949 print FILE
@templist ;
3955 # -------------------------------------------------------------------