]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/cgi-bin/proxy.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
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-2009 marco.s - http://www.advproxy.net
24 # This code is distributed under the terms of the GPL
26 # $Id: advproxy.cgi,v 3.0.2 2009/02/04 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 , 768 , 1024 , 1280 , 1536 , 1792 , 2048 , 2560 , 3072 , 3584 , 4096 , 5120 , 6144 , 7168 , 8192 , 10240 , 12288 , 16384 , 20480 );
59 my $throttle_binary = "7z|arj|bin|bz2|cab|exe|gz|lzh|rar|sea|tar|tgz|xz|zip" ;
60 my $throttle_dskimg = "b5t|bin|bwt|ccd|cdi|cue|gho|img|iso|mds|nrg|pqi|vmdk" ;
61 my $throttle_mmedia = "aiff?|asf|avi|divx|mov|mp3|mpe?g|ogg|qt|ra?m|ts|vob" ;
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 $browser_regexp = '' ;
89 my $acldir = "${General::swroot}/proxy/advanced/acls" ;
90 my $ncsadir = "${General::swroot}/proxy/advanced/ncsa" ;
91 my $ntlmdir = "${General::swroot}/proxy/advanced/ntlm" ;
92 my $raddir = "${General::swroot}/proxy/advanced/radius" ;
93 my $identdir = "${General::swroot}/proxy/advanced/ident" ;
94 my $credir = "${General::swroot}/proxy/advanced/cre" ;
96 my $userdb = " $ncsadir /passwd" ;
97 my $stdgrp = " $ncsadir /standard.grp" ;
98 my $extgrp = " $ncsadir /extended.grp" ;
99 my $disgrp = " $ncsadir /disabled.grp" ;
101 my $browserdb = "${General::swroot}/proxy/advanced/useragents" ;
102 my $mimetypes = "${General::swroot}/proxy/advanced/mimetypes" ;
103 my $throttled_urls = "${General::swroot}/proxy/advanced/throttle" ;
105 my $cre_enabled = "${General::swroot}/proxy/advanced/cre/enable" ;
106 my $cre_groups = "${General::swroot}/proxy/advanced/cre/classrooms" ;
107 my $cre_svhosts = "${General::swroot}/proxy/advanced/cre/supervisors" ;
109 my $identhosts = " $identdir /hosts" ;
111 my $authdir = "/usr/lib/squid/" ;
112 my $errordir = "/usr/lib/squid/errors" ;
114 my $acl_src_subnets = " $acldir /src_subnets.acl" ;
115 my $acl_src_banned_ip = " $acldir /src_banned_ip.acl" ;
116 my $acl_src_banned_mac = " $acldir /src_banned_mac.acl" ;
117 my $acl_src_unrestricted_ip = " $acldir /src_unrestricted_ip.acl" ;
118 my $acl_src_unrestricted_mac = " $acldir /src_unrestricted_mac.acl" ;
119 my $acl_src_noaccess_ip = " $acldir /src_noaccess_ip.acl" ;
120 my $acl_src_noaccess_mac = " $acldir /src_noaccess_mac.acl" ;
121 my $acl_dst_noauth = " $acldir /dst_noauth.acl" ;
122 my $acl_dst_noauth_dom = " $acldir /dst_noauth_dom.acl" ;
123 my $acl_dst_noauth_net = " $acldir /dst_noauth_net.acl" ;
124 my $acl_dst_noauth_url = " $acldir /dst_noauth_url.acl" ;
125 my $acl_dst_nocache = " $acldir /dst_nocache.acl" ;
126 my $acl_dst_nocache_dom = " $acldir /dst_nocache_dom.acl" ;
127 my $acl_dst_nocache_net = " $acldir /dst_nocache_net.acl" ;
128 my $acl_dst_nocache_url = " $acldir /dst_nocache_url.acl" ;
129 my $acl_dst_throttle = " $acldir /dst_throttle.acl" ;
130 my $acl_ports_safe = " $acldir /ports_safe.acl" ;
131 my $acl_ports_ssl = " $acldir /ports_ssl.acl" ;
132 my $acl_include = " $acldir /include.acl" ;
134 my $updaccelversion = 'n/a' ;
135 my $urlfilterversion = 'n/a' ;
137 unless (- d
" $acldir " ) { mkdir ( " $acldir " ); }
138 unless (- d
" $ncsadir " ) { mkdir ( " $ncsadir " ); }
139 unless (- d
" $ntlmdir " ) { mkdir ( " $ntlmdir " ); }
140 unless (- d
" $raddir " ) { mkdir ( " $raddir " ); }
141 unless (- d
" $identdir " ) { mkdir ( " $identdir " ); }
142 unless (- d
" $credir " ) { mkdir ( " $credir " ); }
144 unless (- e
$cre_groups ) { system ( "touch $cre_groups " ); }
145 unless (- e
$cre_svhosts ) { system ( "touch $cre_svhosts " ); }
147 unless (- e
$userdb ) { system ( "touch $userdb " ); }
148 unless (- e
$stdgrp ) { system ( "touch $stdgrp " ); }
149 unless (- e
$extgrp ) { system ( "touch $extgrp " ); }
150 unless (- e
$disgrp ) { system ( "touch $disgrp " ); }
152 unless (- e
$acl_src_subnets ) { system ( "touch $acl_src_subnets " ); }
153 unless (- e
$acl_src_banned_ip ) { system ( "touch $acl_src_banned_ip " ); }
154 unless (- e
$acl_src_banned_mac ) { system ( "touch $acl_src_banned_mac " ); }
155 unless (- e
$acl_src_unrestricted_ip ) { system ( "touch $acl_src_unrestricted_ip " ); }
156 unless (- e
$acl_src_unrestricted_mac ) { system ( "touch $acl_src_unrestricted_mac " ); }
157 unless (- e
$acl_src_noaccess_ip ) { system ( "touch $acl_src_noaccess_ip " ); }
158 unless (- e
$acl_src_noaccess_mac ) { system ( "touch $acl_src_noaccess_mac " ); }
159 unless (- e
$acl_dst_noauth ) { system ( "touch $acl_dst_noauth " ); }
160 unless (- e
$acl_dst_noauth_dom ) { system ( "touch $acl_dst_noauth_dom " ); }
161 unless (- e
$acl_dst_noauth_net ) { system ( "touch $acl_dst_noauth_net " ); }
162 unless (- e
$acl_dst_noauth_url ) { system ( "touch $acl_dst_noauth_url " ); }
163 unless (- e
$acl_dst_nocache ) { system ( "touch $acl_dst_nocache " ); }
164 unless (- e
$acl_dst_nocache_dom ) { system ( "touch $acl_dst_nocache_dom " ); }
165 unless (- e
$acl_dst_nocache_net ) { system ( "touch $acl_dst_nocache_net " ); }
166 unless (- e
$acl_dst_nocache_url ) { system ( "touch $acl_dst_nocache_url " ); }
167 unless (- e
$acl_dst_throttle ) { system ( "touch $acl_dst_throttle " ); }
168 unless (- e
$acl_ports_safe ) { system ( "touch $acl_ports_safe " ); }
169 unless (- e
$acl_ports_ssl ) { system ( "touch $acl_ports_ssl " ); }
170 unless (- e
$acl_include ) { system ( "touch $acl_include " ); }
172 unless (- e
$browserdb ) { system ( "touch $browserdb " ); }
173 unless (- e
$mimetypes ) { system ( "touch $mimetypes " ); }
175 open FILE
, $browserdb ;
176 @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
>;
179 & General
:: readhash
( "${General::swroot}/ethernet/settings" , \
%netsettings );
180 & General
:: readhash
( "${General::swroot}/main/settings" , \
%mainsettings );
182 my $green_cidr = & General
:: ipcidr
( " $netsettings {'GREEN_NETADDRESS'}\/ $netsettings {'GREEN_NETMASK'}" );
184 if (& Header
:: blue_used
() && $netsettings { 'BLUE_DEV' }) {
185 $blue_cidr = & General
:: ipcidr
( " $netsettings {'BLUE_NETADDRESS'}\/ $netsettings {'BLUE_NETMASK'}" );
188 & Header
:: showhttpheaders
();
190 $proxysettings { 'ACTION' } = '' ;
191 $proxysettings { 'VALID' } = '' ;
193 $proxysettings { 'ENABLE' } = 'off' ;
194 $proxysettings { 'ENABLE_BLUE' } = 'off' ;
195 $proxysettings { 'TRANSPARENT' } = 'off' ;
196 $proxysettings { 'TRANSPARENT_BLUE' } = 'off' ;
197 $proxysettings { 'PROXY_PORT' } = '800' ;
198 $proxysettings { 'TRANSPARENT_PORT' } = '3128' ;
199 $proxysettings { 'VISIBLE_HOSTNAME' } = '' ;
200 $proxysettings { 'ADMIN_MAIL_ADDRESS' } = '' ;
201 $proxysettings { 'ADMIN_PASSWORD' } = '' ;
202 $proxysettings { 'ERR_LANGUAGE' } = 'German' ;
203 $proxysettings { 'ERR_DESIGN' } = 'ipfire' ;
204 $proxysettings { 'SUPPRESS_VERSION' } = 'off' ;
205 $proxysettings { 'FORWARD_VIA' } = 'off' ;
206 $proxysettings { 'FORWARD_IPADDRESS' } = 'off' ;
207 $proxysettings { 'FORWARD_USERNAME' } = 'off' ;
208 $proxysettings { 'NO_CONNECTION_AUTH' } = 'off' ;
209 $proxysettings { 'UPSTREAM_PROXY' } = '' ;
210 $proxysettings { 'UPSTREAM_USER' } = '' ;
211 $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;
212 $proxysettings { 'LOGGING' } = 'off' ;
213 $proxysettings { 'CACHEMGR' } = 'off' ;
214 $proxysettings { 'LOGQUERY' } = 'off' ;
215 $proxysettings { 'LOGUSERAGENT' } = 'off' ;
216 $proxysettings { 'FILEDESCRIPTORS' } = '16384' ;
217 $proxysettings { 'CACHE_MEM' } = '2' ;
218 $proxysettings { 'CACHE_SIZE' } = '50' ;
219 $proxysettings { 'MAX_SIZE' } = '4096' ;
220 $proxysettings { 'MIN_SIZE' } = '0' ;
221 $proxysettings { 'MEM_POLICY' } = 'LRU' ;
222 $proxysettings { 'CACHE_POLICY' } = 'LRU' ;
223 $proxysettings { 'L1_DIRS' } = '16' ;
224 $proxysettings { 'OFFLINE_MODE' } = 'off' ;
225 $proxysettings { 'CACHE_DIGESTS' } = 'off' ;
226 $proxysettings { 'CLASSROOM_EXT' } = 'off' ;
227 $proxysettings { 'SUPERVISOR_PASSWORD' } = '' ;
228 $proxysettings { 'NO_PROXY_LOCAL' } = 'off' ;
229 $proxysettings { 'NO_PROXY_LOCAL_BLUE' } = 'off' ;
230 $proxysettings { 'TIME_ACCESS_MODE' } = 'allow' ;
231 $proxysettings { 'TIME_FROM_HOUR' } = '00' ;
232 $proxysettings { 'TIME_FROM_MINUTE' } = '00' ;
233 $proxysettings { 'TIME_TO_HOUR' } = '24' ;
234 $proxysettings { 'TIME_TO_MINUTE' } = '00' ;
235 $proxysettings { 'MAX_OUTGOING_SIZE' } = '0' ;
236 $proxysettings { 'MAX_INCOMING_SIZE' } = '0' ;
237 $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;
238 $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;
239 $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;
240 $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;
241 $proxysettings { 'THROTTLE_BINARY' } = 'off' ;
242 $proxysettings { 'THROTTLE_DSKIMG' } = 'off' ;
243 $proxysettings { 'THROTTLE_MMEDIA' } = 'off' ;
244 $proxysettings { 'ENABLE_MIME_FILTER' } = 'off' ;
245 $proxysettings { 'ENABLE_BROWSER_CHECK' } = 'off' ;
246 $proxysettings { 'FAKE_USERAGENT' } = '' ;
247 $proxysettings { 'FAKE_REFERER' } = '' ;
248 $proxysettings { 'AUTH_METHOD' } = 'none' ;
249 $proxysettings { 'AUTH_REALM' } = '' ;
250 $proxysettings { 'AUTH_MAX_USERIP' } = '' ;
251 $proxysettings { 'AUTH_CACHE_TTL' } = '60' ;
252 $proxysettings { 'AUTH_IPCACHE_TTL' } = '0' ;
253 $proxysettings { 'AUTH_CHILDREN' } = '5' ;
254 $proxysettings { 'NCSA_MIN_PASS_LEN' } = '6' ;
255 $proxysettings { 'NCSA_BYPASS_REDIR' } = 'off' ;
256 $proxysettings { 'NCSA_USERNAME' } = '' ;
257 $proxysettings { 'NCSA_GROUP' } = '' ;
258 $proxysettings { 'NCSA_PASS' } = '' ;
259 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
260 $proxysettings { 'LDAP_BASEDN' } = '' ;
261 $proxysettings { 'LDAP_TYPE' } = 'ADS' ;
262 $proxysettings { 'LDAP_SERVER' } = '' ;
263 $proxysettings { 'LDAP_PORT' } = '389' ;
264 $proxysettings { 'LDAP_BINDDN_USER' } = '' ;
265 $proxysettings { 'LDAP_BINDDN_PASS' } = '' ;
266 $proxysettings { 'LDAP_GROUP' } = '' ;
267 $proxysettings { 'NTLM_DOMAIN' } = '' ;
268 $proxysettings { 'NTLM_PDC' } = '' ;
269 $proxysettings { 'NTLM_BDC' } = '' ;
270 $proxysettings { 'NTLM_ENABLE_ACL' } = 'off' ;
271 $proxysettings { 'NTLM_USER_ACL' } = 'positive' ;
272 $proxysettings { 'RADIUS_SERVER' } = '' ;
273 $proxysettings { 'RADIUS_PORT' } = '1812' ;
274 $proxysettings { 'RADIUS_IDENTIFIER' } = '' ;
275 $proxysettings { 'RADIUS_SECRET' } = '' ;
276 $proxysettings { 'RADIUS_ENABLE_ACL' } = 'off' ;
277 $proxysettings { 'RADIUS_USER_ACL' } = 'positive' ;
278 $proxysettings { 'IDENT_REQUIRED' } = 'off' ;
279 $proxysettings { 'IDENT_TIMEOUT' } = '10' ;
280 $proxysettings { 'IDENT_ENABLE_ACL' } = 'off' ;
281 $proxysettings { 'IDENT_USER_ACL' } = 'positive' ;
282 $proxysettings { 'ENABLE_FILTER' } = 'off' ;
283 $proxysettings { 'ENABLE_UPDXLRATOR' } = 'off' ;
284 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
285 $proxysettings { 'CHILDREN' } = '10' ;
287 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA create user' };
289 & Header
:: getcgihash
( \
%proxysettings );
291 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_TOTAL' } = 'unlimited' ;}
292 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_GREEN_HOST' } = 'unlimited' ;}
293 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_TOTAL' } = 'unlimited' ;}
294 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 0 ) { $proxysettings { 'THROTTLING_BLUE_HOST' } = 'unlimited' ;}
296 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy NCSA user management' })
298 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
301 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'add' })
303 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
304 if ( length ( $proxysettings { 'NCSA_PASS' }) < $proxysettings { 'NCSA_MIN_PASS_LEN' }) {
305 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length 1' }. $proxysettings { 'NCSA_MIN_PASS_LEN' }. $Lang :: tr
{ 'advproxy errmsg password length 2' };
307 if (!( $proxysettings { 'NCSA_PASS' } eq $proxysettings { 'NCSA_PASS_CONFIRM' })) {
308 $errormessage = $Lang :: tr
{ 'advproxy errmsg passwords different' };
310 if ( $proxysettings { 'NCSA_USERNAME' } eq '' ) {
311 $errormessage = $Lang :: tr
{ 'advproxy errmsg no username' };
313 if (! $errormessage ) {
314 $proxysettings { 'NCSA_USERNAME' } =~ tr/A-Z/a-z/ ;
315 & adduser
( $proxysettings { 'NCSA_USERNAME' }, $proxysettings { 'NCSA_PASS' }, $proxysettings { 'NCSA_GROUP' });
317 $proxysettings { 'NCSA_USERNAME' } = '' ;
318 $proxysettings { 'NCSA_GROUP' } = '' ;
319 $proxysettings { 'NCSA_PASS' } = '' ;
320 $proxysettings { 'NCSA_PASS_CONFIRM' } = '' ;
323 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'remove' })
325 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
326 & deluser
( $proxysettings { 'ID' });
329 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
330 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
331 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
333 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' })
335 $proxysettings { 'NCSA_EDIT_MODE' } = 'yes' ;
336 $ncsa_buttontext = $Lang :: tr
{ 'advproxy NCSA update user' };
337 @temp = split ( /:/ , $proxysettings { 'ID' });
338 $proxysettings { 'NCSA_USERNAME' } = $temp [ 0 ];
339 $proxysettings { 'NCSA_GROUP' } = $temp [ 1 ];
340 $proxysettings { 'NCSA_PASS' } = "lEaVeAlOnE" ;
341 $proxysettings { 'NCSA_PASS_CONFIRM' } = $proxysettings { 'NCSA_PASS' };
344 if (( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'save' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) || ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'proxy reconfigure' }))
346 if ( $proxysettings { 'ENABLE' } !~ /^(on|off)$/ ||
347 $proxysettings { 'TRANSPARENT' } !~ /^(on|off)$/ ||
348 $proxysettings { 'ENABLE_BLUE' } !~ /^(on|off)$/ ||
349 $proxysettings { 'TRANSPARENT_BLUE' } !~ /^(on|off)$/ ) {
350 $errormessage = $Lang :: tr
{ 'invalid input' };
353 if ( $proxysettings { 'CACHE_MEM' } > $proxysettings { 'CACHE_SIZE' } && $proxysettings { 'CACHE_SIZE' } > 0 ){
354 $errormessage = $Lang :: tr
{ 'advproxy errmsg cache' }. " " . $proxysettings { 'CACHE_MEM' }. " > " . $proxysettings { 'CACHE_SIZE' };
358 if (!(& General
:: validport
( $proxysettings { 'PROXY_PORT' })))
360 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
363 if (!(& General
:: validport
( $proxysettings { 'TRANSPARENT_PORT' })))
365 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid proxy port' };
368 if ( $proxysettings { 'PROXY_PORT' } eq $proxysettings { 'TRANSPARENT_PORT' }) {
369 $errormessage = $Lang :: tr
{ 'advproxy errmsg proxy ports equal' };
372 if (!( $proxysettings { 'UPSTREAM_PROXY' } eq '' ))
374 my @temp = split ( /:/ , $proxysettings { 'UPSTREAM_PROXY' });
375 if (!(& General
:: validip
( $temp [ 0 ])))
377 if (!(& General
:: validdomainname
( $temp [ 0 ])))
379 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy' };
384 if (!( $proxysettings { 'CACHE_SIZE' } =~ /^\d+/ ) ||
385 ( $proxysettings { 'CACHE_SIZE' } < 10 ))
387 if (!( $proxysettings { 'CACHE_SIZE' } eq '0' ))
389 $errormessage = $Lang :: tr
{ 'advproxy errmsg hdd cache size' };
393 if (!( $proxysettings { 'FILEDESCRIPTORS' } =~ /^\d+/ ) ||
394 ( $proxysettings { 'FILEDESCRIPTORS' } < 1 ) || ( $proxysettings { 'FILEDESCRIPTORS' } > 1048576 ))
396 $errormessage = $Lang :: tr
{ 'proxy errmsg filedescriptors' };
399 if (!( $proxysettings { 'CACHE_MEM' } =~ /^\d+/ ) ||
400 ( $proxysettings { 'CACHE_MEM' } < 1 ))
402 $errormessage = $Lang :: tr
{ 'advproxy errmsg mem cache size' };
405 my @free = `/usr/bin/free` ;
406 $free [ 1 ] =~ m/(\d+)/ ;
407 $cachemem = int $1 / 2048 ;
408 if ( $proxysettings { 'CACHE_MEM' } > $cachemem ) {
409 $proxysettings { 'CACHE_MEM' } = $cachemem ;
411 if (!( $proxysettings { 'MAX_SIZE' } =~ /^\d+/ ))
413 $errormessage = $Lang :: tr
{ 'invalid maximum object size' };
416 if (!( $proxysettings { 'MIN_SIZE' } =~ /^\d+/ ))
418 $errormessage = $Lang :: tr
{ 'invalid minimum object size' };
421 if (!( $proxysettings { 'MAX_OUTGOING_SIZE' } =~ /^\d+/ ))
423 $errormessage = $Lang :: tr
{ 'invalid maximum outgoing size' };
426 if (!( $proxysettings { 'TIME_TO_HOUR' }. $proxysettings { 'TIME_TO_MINUTE' } gt $proxysettings { 'TIME_FROM_HOUR' }. $proxysettings { 'TIME_FROM_MINUTE' }))
428 $errormessage = $Lang :: tr
{ 'advproxy errmsg time restriction' };
431 if (!( $proxysettings { 'MAX_INCOMING_SIZE' } =~ /^\d+/ ))
433 $errormessage = $Lang :: tr
{ 'invalid maximum incoming size' };
436 if (!( $proxysettings { 'CHILDREN' } =~ /^\d+$/ ) || ( $proxysettings { 'CHILDREN' } < 1 ))
438 $errormessage = $Lang :: tr
{ 'advproxy invalid num of children' };
441 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' )
443 $browser_regexp = '' ;
444 foreach ( @useragentlist )
447 @useragent = split ( /,/ );
448 if ( $proxysettings { 'UA_' . $useragent [ 0 ]} eq 'on' ) { $browser_regexp .= " $useragent [2]|" ; }
450 chop ( $browser_regexp );
451 if (! $browser_regexp )
453 $errormessage = $Lang :: tr
{ 'advproxy errmsg no browser' };
457 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' ))
459 unless (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
460 ( $proxysettings { 'IDENT_REQUIRED' } eq 'off' ) &&
461 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'off' ))
463 if ( $netsettings { 'BLUE_DEV' })
465 if ((( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' )) &&
466 (( $proxysettings { 'ENABLE_BLUE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' )))
468 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
472 if (( $proxysettings { 'ENABLE' } eq 'off' ) || ( $proxysettings { 'TRANSPARENT' } eq 'on' ))
474 $errormessage = $Lang :: tr
{ 'advproxy errmsg non-transparent proxy required' };
479 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) &&
480 ((!( $proxysettings { 'AUTH_MAX_USERIP' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_MAX_USERIP' } < 1 ) || ( $proxysettings { 'AUTH_MAX_USERIP' } > 255 )))
482 $errormessage = $Lang :: tr
{ 'advproxy errmsg max userip' };
485 if (!( $proxysettings { 'AUTH_CACHE_TTL' } =~ /^\d+/ ))
487 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth cache ttl' };
490 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } =~ /^\d+/ ))
492 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache ttl' };
495 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && ( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' ))
497 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth ipcache may not be null' };
500 if ((!( $proxysettings { 'AUTH_CHILDREN' } =~ /^\d+/ )) || ( $proxysettings { 'AUTH_CHILDREN' } < 1 ) || ( $proxysettings { 'AUTH_CHILDREN' } > 255 ))
502 $errormessage = $Lang :: tr
{ 'advproxy errmsg auth children' };
506 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
508 if ((!( $proxysettings { 'NCSA_MIN_PASS_LEN' } =~ /^\d+/ )) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } < 1 ) || ( $proxysettings { 'NCSA_MIN_PASS_LEN' } > 255 ))
510 $errormessage = $Lang :: tr
{ 'advproxy errmsg password length' };
514 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
516 if ((!( $proxysettings { 'IDENT_TIMEOUT' } =~ /^\d+/ )) || ( $proxysettings { 'IDENT_TIMEOUT' } < 1 ))
518 $errormessage = $Lang :: tr
{ 'advproxy errmsg ident timeout' };
522 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
524 if ( $proxysettings { 'LDAP_BASEDN' } eq '' )
526 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap base dn' };
529 if (!& General
:: validip
( $proxysettings { 'LDAP_SERVER' }))
531 if (!& General
:: validdomainname
( $proxysettings { 'LDAP_SERVER' }))
533 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap server' };
537 if (!& General
:: validport
( $proxysettings { 'LDAP_PORT' }))
539 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap port' };
542 if (( $proxysettings { 'LDAP_TYPE' } eq 'ADS' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' ))
544 if (( $proxysettings { 'LDAP_BINDDN_USER' } eq '' ) || ( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' ))
546 $errormessage = $Lang :: tr
{ 'advproxy errmsg ldap bind dn' };
551 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
553 if ( $proxysettings { 'NTLM_DOMAIN' } eq '' )
555 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm domain' };
558 if ( $proxysettings { 'NTLM_PDC' } eq '' )
560 $errormessage = $Lang :: tr
{ 'advproxy errmsg ntlm pdc' };
563 if (!& General
:: validhostname
( $proxysettings { 'NTLM_PDC' }))
565 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid pdc' };
568 if ((!( $proxysettings { 'NTLM_BDC' } eq '' )) && (!& General
:: validhostname
( $proxysettings { 'NTLM_BDC' })))
570 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid bdc' };
574 $proxysettings { 'NTLM_DOMAIN' } = lc ( $proxysettings { 'NTLM_DOMAIN' });
575 $proxysettings { 'NTLM_PDC' } = lc ( $proxysettings { 'NTLM_PDC' });
576 $proxysettings { 'NTLM_BDC' } = lc ( $proxysettings { 'NTLM_BDC' });
578 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
580 if (!& General
:: validip
( $proxysettings { 'RADIUS_SERVER' }))
582 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius server' };
585 if (!& General
:: validport
( $proxysettings { 'RADIUS_PORT' }))
587 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius port' };
590 if ( $proxysettings { 'RADIUS_SECRET' } eq '' )
592 $errormessage = $Lang :: tr
{ 'advproxy errmsg radius secret' };
597 # Quick parent proxy error checking of username and password info. If username password don't both exist give an error.
600 if (( $proxysettings { 'UPSTREAM_USER' } eq '' )) { $proxy1 = '' ;}
601 if (( $proxysettings { 'UPSTREAM_PASSWORD' } eq '' )) { $proxy2 = '' ;}
602 if ( $proxysettings { 'UPSTREAM_USER' } eq 'PASS' ) { $proxy1 = $proxy2 = 'PASS' ; $proxysettings { 'UPSTREAM_PASSWORD' } = '' ;}
603 if (( $proxy1 ne $proxy2 ))
605 $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid upstream proxy username or password setting' };
613 $proxysettings { 'VALID' } = 'no' ; }
615 $proxysettings { 'VALID' } = 'yes' ; }
617 if ( $proxysettings { 'VALID' } eq 'yes' )
621 delete $proxysettings { 'SRC_SUBNETS' };
622 delete $proxysettings { 'SRC_BANNED_IP' };
623 delete $proxysettings { 'SRC_BANNED_MAC' };
624 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
625 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
626 delete $proxysettings { 'DST_NOCACHE' };
627 delete $proxysettings { 'DST_NOAUTH' };
628 delete $proxysettings { 'PORTS_SAFE' };
629 delete $proxysettings { 'PORTS_SSL' };
630 delete $proxysettings { 'MIME_TYPES' };
631 delete $proxysettings { 'NTLM_ALLOW_USERS' };
632 delete $proxysettings { 'NTLM_DENY_USERS' };
633 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
634 delete $proxysettings { 'RADIUS_DENY_USERS' };
635 delete $proxysettings { 'IDENT_HOSTS' };
636 delete $proxysettings { 'IDENT_ALLOW_USERS' };
637 delete $proxysettings { 'IDENT_DENY_USERS' };
639 delete $proxysettings { 'CRE_GROUPS' };
640 delete $proxysettings { 'CRE_SVHOSTS' };
642 delete $proxysettings { 'NCSA_USERNAME' };
643 delete $proxysettings { 'NCSA_GROUP' };
644 delete $proxysettings { 'NCSA_PASS' };
645 delete $proxysettings { 'NCSA_PASS_CONFIRM' };
647 $proxysettings { 'TIME_MON' } = 'off' unless exists $proxysettings { 'TIME_MON' };
648 $proxysettings { 'TIME_TUE' } = 'off' unless exists $proxysettings { 'TIME_TUE' };
649 $proxysettings { 'TIME_WED' } = 'off' unless exists $proxysettings { 'TIME_WED' };
650 $proxysettings { 'TIME_THU' } = 'off' unless exists $proxysettings { 'TIME_THU' };
651 $proxysettings { 'TIME_FRI' } = 'off' unless exists $proxysettings { 'TIME_FRI' };
652 $proxysettings { 'TIME_SAT' } = 'off' unless exists $proxysettings { 'TIME_SAT' };
653 $proxysettings { 'TIME_SUN' } = 'off' unless exists $proxysettings { 'TIME_SUN' };
655 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'off' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
656 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'off' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
658 & General
:: writehash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
660 if (- e
"${General::swroot}/proxy/settings" ) { & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings ); }
661 $stdproxysettings { 'PROXY_PORT' } = $proxysettings { 'PROXY_PORT' };
662 $stdproxysettings { 'UPSTREAM_PROXY' } = $proxysettings { 'UPSTREAM_PROXY' };
663 $stdproxysettings { 'UPSTREAM_USER' } = $proxysettings { 'UPSTREAM_USER' };
664 $stdproxysettings { 'UPSTREAM_PASSWORD' } = $proxysettings { 'UPSTREAM_PASSWORD' };
665 $stdproxysettings { 'ENABLE_FILTER' } = $proxysettings { 'ENABLE_FILTER' };
666 $stdproxysettings { 'ENABLE_UPDXLRATOR' } = $proxysettings { 'ENABLE_UPDXLRATOR' };
667 $stdproxysettings { 'ENABLE_CLAMAV' } = $proxysettings { 'ENABLE_CLAMAV' };
668 & General
:: writehash
( "${General::swroot}/proxy/settings" , \
%stdproxysettings );
673 if ( $proxysettings { 'CACHEMGR' } eq 'on' ){& writecachemgr
;}
675 system ( '/usr/local/bin/squidctrl' , 'disable' );
676 unlink "${General::swroot}/proxy/enable" ;
677 unlink "${General::swroot}/proxy/transparent" ;
678 unlink "${General::swroot}/proxy/enable_blue" ;
679 unlink "${General::swroot}/proxy/transparent_blue" ;
681 if ( $proxysettings { 'ENABLE' } eq 'on' ) {
682 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable" );
683 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
684 if ( $proxysettings { 'TRANSPARENT' } eq 'on' && $proxysettings { 'ENABLE' } eq 'on' ) {
685 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent" ); }
686 if ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
687 system ( '/usr/bin/touch' , "${General::swroot}/proxy/enable_blue" );
688 system ( '/usr/local/bin/squidctrl' , 'enable' ); }
689 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
690 system ( '/usr/bin/touch' , "${General::swroot}/proxy/transparent_blue" ); }
692 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy save and restart' }) { system ( '/usr/local/bin/squidctrl restart >/dev/null 2>&1' ); }
693 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'proxy reconfigure' }) { system ( '/usr/local/bin/squidctrl reconfigure >/dev/null 2>&1' ); }
697 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'advproxy clear cache' })
699 system ( '/usr/local/bin/squidctrl flush >/dev/null 2>&1' );
704 if (- e
"${General::swroot}/proxy/advanced/settings" ) {
705 & General
:: readhash
( "${General::swroot}/proxy/advanced/settings" , \
%proxysettings );
706 } elsif (- e
"${General::swroot}/proxy/settings" ) {
707 & General
:: readhash
( "${General::swroot}/proxy/settings" , \
%proxysettings );
712 # ------------------------------------------------------------------
714 # Hook to regenerate the configuration files, if cgi got called from command line.
715 if ( $ENV { "REMOTE_ADDR" } eq "" ) {
720 # -------------------------------------------------------------------
722 $checked { 'ENABLE' }{ 'off' } = '' ;
723 $checked { 'ENABLE' }{ 'on' } = '' ;
724 $checked { 'ENABLE' }{ $proxysettings { 'ENABLE' }} = "checked='checked'" ;
726 $checked { 'TRANSPARENT' }{ 'off' } = '' ;
727 $checked { 'TRANSPARENT' }{ 'on' } = '' ;
728 $checked { 'TRANSPARENT' }{ $proxysettings { 'TRANSPARENT' }} = "checked='checked'" ;
730 $checked { 'ENABLE_BLUE' }{ 'off' } = '' ;
731 $checked { 'ENABLE_BLUE' }{ 'on' } = '' ;
732 $checked { 'ENABLE_BLUE' }{ $proxysettings { 'ENABLE_BLUE' }} = "checked='checked'" ;
734 $checked { 'TRANSPARENT_BLUE' }{ 'off' } = '' ;
735 $checked { 'TRANSPARENT_BLUE' }{ 'on' } = '' ;
736 $checked { 'TRANSPARENT_BLUE' }{ $proxysettings { 'TRANSPARENT_BLUE' }} = "checked='checked'" ;
738 $checked { 'SUPPRESS_VERSION' }{ 'off' } = '' ;
739 $checked { 'SUPPRESS_VERSION' }{ 'on' } = '' ;
740 $checked { 'SUPPRESS_VERSION' }{ $proxysettings { 'SUPPRESS_VERSION' }} = "checked='checked'" ;
742 $checked { 'FORWARD_IPADDRESS' }{ 'off' } = '' ;
743 $checked { 'FORWARD_IPADDRESS' }{ 'on' } = '' ;
744 $checked { 'FORWARD_IPADDRESS' }{ $proxysettings { 'FORWARD_IPADDRESS' }} = "checked='checked'" ;
745 $checked { 'FORWARD_USERNAME' }{ 'off' } = '' ;
746 $checked { 'FORWARD_USERNAME' }{ 'on' } = '' ;
747 $checked { 'FORWARD_USERNAME' }{ $proxysettings { 'FORWARD_USERNAME' }} = "checked='checked'" ;
748 $checked { 'FORWARD_VIA' }{ 'off' } = '' ;
749 $checked { 'FORWARD_VIA' }{ 'on' } = '' ;
750 $checked { 'FORWARD_VIA' }{ $proxysettings { 'FORWARD_VIA' }} = "checked='checked'" ;
751 $checked { 'NO_CONNECTION_AUTH' }{ 'off' } = '' ;
752 $checked { 'NO_CONNECTION_AUTH' }{ 'on' } = '' ;
753 $checked { 'NO_CONNECTION_AUTH' }{ $proxysettings { 'NO_CONNECTION_AUTH' }} = "checked='checked'" ;
755 $selected { 'MEM_POLICY' }{ $proxysettings { 'MEM_POLICY' }} = "selected='selected'" ;
756 $selected { 'CACHE_POLICY' }{ $proxysettings { 'CACHE_POLICY' }} = "selected='selected'" ;
757 $selected { 'L1_DIRS' }{ $proxysettings { 'L1_DIRS' }} = "selected='selected'" ;
758 $checked { 'OFFLINE_MODE' }{ 'off' } = '' ;
759 $checked { 'OFFLINE_MODE' }{ 'on' } = '' ;
760 $checked { 'OFFLINE_MODE' }{ $proxysettings { 'OFFLINE_MODE' }} = "checked='checked'" ;
761 $checked { 'CACHE_DIGESTS' }{ 'off' } = '' ;
762 $checked { 'CACHE_DIGESTS' }{ 'on' } = '' ;
763 $checked { 'CACHE_DIGESTS' }{ $proxysettings { 'CACHE_DIGESTS' }} = "checked='checked'" ;
765 $checked { 'LOGGING' }{ 'off' } = '' ;
766 $checked { 'LOGGING' }{ 'on' } = '' ;
767 $checked { 'LOGGING' }{ $proxysettings { 'LOGGING' }} = "checked='checked'" ;
768 $checked { 'CACHEMGR' }{ 'off' } = '' ;
769 $checked { 'CACHEMGR' }{ 'on' } = '' ;
770 $checked { 'CACHEMGR' }{ $proxysettings { 'CACHEMGR' }} = "checked='checked'" ;
771 $checked { 'LOGQUERY' }{ 'off' } = '' ;
772 $checked { 'LOGQUERY' }{ 'on' } = '' ;
773 $checked { 'LOGQUERY' }{ $proxysettings { 'LOGQUERY' }} = "checked='checked'" ;
774 $checked { 'LOGUSERAGENT' }{ 'off' } = '' ;
775 $checked { 'LOGUSERAGENT' }{ 'on' } = '' ;
776 $checked { 'LOGUSERAGENT' }{ $proxysettings { 'LOGUSERAGENT' }} = "checked='checked'" ;
778 $selected { 'ERR_LANGUAGE' }{ $proxysettings { 'ERR_LANGUAGE' }} = "selected='selected'" ;
779 $selected { 'ERR_DESIGN' }{ $proxysettings { 'ERR_DESIGN' }} = "selected='selected'" ;
781 $checked { 'NO_PROXY_LOCAL' }{ 'off' } = '' ;
782 $checked { 'NO_PROXY_LOCAL' }{ 'on' } = '' ;
783 $checked { 'NO_PROXY_LOCAL' }{ $proxysettings { 'NO_PROXY_LOCAL' }} = "checked='checked'" ;
784 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'off' } = '' ;
785 $checked { 'NO_PROXY_LOCAL_BLUE' }{ 'on' } = '' ;
786 $checked { 'NO_PROXY_LOCAL_BLUE' }{ $proxysettings { 'NO_PROXY_LOCAL_BLUE' }} = "checked='checked'" ;
788 $checked { 'CLASSROOM_EXT' }{ 'off' } = '' ;
789 $checked { 'CLASSROOM_EXT' }{ 'on' } = '' ;
790 $checked { 'CLASSROOM_EXT' }{ $proxysettings { 'CLASSROOM_EXT' }} = "checked='checked'" ;
792 $selected { 'TIME_ACCESS_MODE' }{ $proxysettings { 'TIME_ACCESS_MODE' }} = "selected='selected'" ;
793 $selected { 'TIME_FROM_HOUR' }{ $proxysettings { 'TIME_FROM_HOUR' }} = "selected='selected'" ;
794 $selected { 'TIME_FROM_MINUTE' }{ $proxysettings { 'TIME_FROM_MINUTE' }} = "selected='selected'" ;
795 $selected { 'TIME_TO_HOUR' }{ $proxysettings { 'TIME_TO_HOUR' }} = "selected='selected'" ;
796 $selected { 'TIME_TO_MINUTE' }{ $proxysettings { 'TIME_TO_MINUTE' }} = "selected='selected'" ;
798 $proxysettings { 'TIME_MON' } = 'on' unless exists $proxysettings { 'TIME_MON' };
799 $proxysettings { 'TIME_TUE' } = 'on' unless exists $proxysettings { 'TIME_TUE' };
800 $proxysettings { 'TIME_WED' } = 'on' unless exists $proxysettings { 'TIME_WED' };
801 $proxysettings { 'TIME_THU' } = 'on' unless exists $proxysettings { 'TIME_THU' };
802 $proxysettings { 'TIME_FRI' } = 'on' unless exists $proxysettings { 'TIME_FRI' };
803 $proxysettings { 'TIME_SAT' } = 'on' unless exists $proxysettings { 'TIME_SAT' };
804 $proxysettings { 'TIME_SUN' } = 'on' unless exists $proxysettings { 'TIME_SUN' };
806 $checked { 'TIME_MON' }{ 'off' } = '' ;
807 $checked { 'TIME_MON' }{ 'on' } = '' ;
808 $checked { 'TIME_MON' }{ $proxysettings { 'TIME_MON' }} = "checked='checked'" ;
809 $checked { 'TIME_TUE' }{ 'off' } = '' ;
810 $checked { 'TIME_TUE' }{ 'on' } = '' ;
811 $checked { 'TIME_TUE' }{ $proxysettings { 'TIME_TUE' }} = "checked='checked'" ;
812 $checked { 'TIME_WED' }{ 'off' } = '' ;
813 $checked { 'TIME_WED' }{ 'on' } = '' ;
814 $checked { 'TIME_WED' }{ $proxysettings { 'TIME_WED' }} = "checked='checked'" ;
815 $checked { 'TIME_THU' }{ 'off' } = '' ;
816 $checked { 'TIME_THU' }{ 'on' } = '' ;
817 $checked { 'TIME_THU' }{ $proxysettings { 'TIME_THU' }} = "checked='checked'" ;
818 $checked { 'TIME_FRI' }{ 'off' } = '' ;
819 $checked { 'TIME_FRI' }{ 'on' } = '' ;
820 $checked { 'TIME_FRI' }{ $proxysettings { 'TIME_FRI' }} = "checked='checked'" ;
821 $checked { 'TIME_SAT' }{ 'off' } = '' ;
822 $checked { 'TIME_SAT' }{ 'on' } = '' ;
823 $checked { 'TIME_SAT' }{ $proxysettings { 'TIME_SAT' }} = "checked='checked'" ;
824 $checked { 'TIME_SUN' }{ 'off' } = '' ;
825 $checked { 'TIME_SUN' }{ 'on' } = '' ;
826 $checked { 'TIME_SUN' }{ $proxysettings { 'TIME_SUN' }} = "checked='checked'" ;
828 $selected { 'THROTTLING_GREEN_TOTAL' }{ $proxysettings { 'THROTTLING_GREEN_TOTAL' }} = "selected='selected'" ;
829 $selected { 'THROTTLING_GREEN_HOST' }{ $proxysettings { 'THROTTLING_GREEN_HOST' }} = "selected='selected'" ;
830 $selected { 'THROTTLING_BLUE_TOTAL' }{ $proxysettings { 'THROTTLING_BLUE_TOTAL' }} = "selected='selected'" ;
831 $selected { 'THROTTLING_BLUE_HOST' }{ $proxysettings { 'THROTTLING_BLUE_HOST' }} = "selected='selected'" ;
833 $checked { 'THROTTLE_BINARY' }{ 'off' } = '' ;
834 $checked { 'THROTTLE_BINARY' }{ 'on' } = '' ;
835 $checked { 'THROTTLE_BINARY' }{ $proxysettings { 'THROTTLE_BINARY' }} = "checked='checked'" ;
836 $checked { 'THROTTLE_DSKIMG' }{ 'off' } = '' ;
837 $checked { 'THROTTLE_DSKIMG' }{ 'on' } = '' ;
838 $checked { 'THROTTLE_DSKIMG' }{ $proxysettings { 'THROTTLE_DSKIMG' }} = "checked='checked'" ;
839 $checked { 'THROTTLE_MMEDIA' }{ 'off' } = '' ;
840 $checked { 'THROTTLE_MMEDIA' }{ 'on' } = '' ;
841 $checked { 'THROTTLE_MMEDIA' }{ $proxysettings { 'THROTTLE_MMEDIA' }} = "checked='checked'" ;
843 $checked { 'ENABLE_MIME_FILTER' }{ 'off' } = '' ;
844 $checked { 'ENABLE_MIME_FILTER' }{ 'on' } = '' ;
845 $checked { 'ENABLE_MIME_FILTER' }{ $proxysettings { 'ENABLE_MIME_FILTER' }} = "checked='checked'" ;
847 $checked { 'ENABLE_BROWSER_CHECK' }{ 'off' } = '' ;
848 $checked { 'ENABLE_BROWSER_CHECK' }{ 'on' } = '' ;
849 $checked { 'ENABLE_BROWSER_CHECK' }{ $proxysettings { 'ENABLE_BROWSER_CHECK' }} = "checked='checked'" ;
851 foreach ( @useragentlist ) {
852 @useragent = split ( /,/ );
853 $checked { 'UA_' . $useragent [ 0 ]}{ 'off' } = '' ;
854 $checked { 'UA_' . $useragent [ 0 ]}{ 'on' } = '' ;
855 $checked { 'UA_' . $useragent [ 0 ]}{ $proxysettings { 'UA_' . $useragent [ 0 ]}} = "checked='checked'" ;
858 $checked { 'AUTH_METHOD' }{ 'none' } = '' ;
859 $checked { 'AUTH_METHOD' }{ 'ncsa' } = '' ;
860 $checked { 'AUTH_METHOD' }{ 'ident' } = '' ;
861 $checked { 'AUTH_METHOD' }{ 'ldap' } = '' ;
862 $checked { 'AUTH_METHOD' }{ 'ntlm' } = '' ;
863 $checked { 'AUTH_METHOD' }{ 'radius' } = '' ;
864 $checked { 'AUTH_METHOD' }{ $proxysettings { 'AUTH_METHOD' }} = "checked='checked'" ;
866 $proxysettings { 'AUTH_ALWAYS_REQUIRED' } = 'on' unless exists $proxysettings { 'AUTH_ALWAYS_REQUIRED' };
868 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'off' } = '' ;
869 $checked { 'AUTH_ALWAYS_REQUIRED' }{ 'on' } = '' ;
870 $checked { 'AUTH_ALWAYS_REQUIRED' }{ $proxysettings { 'AUTH_ALWAYS_REQUIRED' }} = "checked='checked'" ;
872 $checked { 'NCSA_BYPASS_REDIR' }{ 'off' } = '' ;
873 $checked { 'NCSA_BYPASS_REDIR' }{ 'on' } = '' ;
874 $checked { 'NCSA_BYPASS_REDIR' }{ $proxysettings { 'NCSA_BYPASS_REDIR' }} = "checked='checked'" ;
876 $selected { 'NCSA_GROUP' }{ $proxysettings { 'NCSA_GROUP' }} = "selected='selected'" ;
878 $selected { 'LDAP_TYPE' }{ $proxysettings { 'LDAP_TYPE' }} = "selected='selected'" ;
880 $proxysettings { 'NTLM_ENABLE_INT_AUTH' } = 'on' unless exists $proxysettings { 'NTLM_ENABLE_INT_AUTH' };
882 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'off' } = '' ;
883 $checked { 'NTLM_ENABLE_INT_AUTH' }{ 'on' } = '' ;
884 $checked { 'NTLM_ENABLE_INT_AUTH' }{ $proxysettings { 'NTLM_ENABLE_INT_AUTH' }} = "checked='checked'" ;
886 $checked { 'NTLM_ENABLE_ACL' }{ 'off' } = '' ;
887 $checked { 'NTLM_ENABLE_ACL' }{ 'on' } = '' ;
888 $checked { 'NTLM_ENABLE_ACL' }{ $proxysettings { 'NTLM_ENABLE_ACL' }} = "checked='checked'" ;
890 $checked { 'NTLM_USER_ACL' }{ 'positive' } = '' ;
891 $checked { 'NTLM_USER_ACL' }{ 'negative' } = '' ;
892 $checked { 'NTLM_USER_ACL' }{ $proxysettings { 'NTLM_USER_ACL' }} = "checked='checked'" ;
894 $checked { 'RADIUS_ENABLE_ACL' }{ 'off' } = '' ;
895 $checked { 'RADIUS_ENABLE_ACL' }{ 'on' } = '' ;
896 $checked { 'RADIUS_ENABLE_ACL' }{ $proxysettings { 'RADIUS_ENABLE_ACL' }} = "checked='checked'" ;
898 $checked { 'RADIUS_USER_ACL' }{ 'positive' } = '' ;
899 $checked { 'RADIUS_USER_ACL' }{ 'negative' } = '' ;
900 $checked { 'RADIUS_USER_ACL' }{ $proxysettings { 'RADIUS_USER_ACL' }} = "checked='checked'" ;
902 $checked { 'IDENT_REQUIRED' }{ 'off' } = '' ;
903 $checked { 'IDENT_REQUIRED' }{ 'on' } = '' ;
904 $checked { 'IDENT_REQUIRED' }{ $proxysettings { 'IDENT_REQUIRED' }} = "checked='checked'" ;
906 $checked { 'IDENT_ENABLE_ACL' }{ 'off' } = '' ;
907 $checked { 'IDENT_ENABLE_ACL' }{ 'on' } = '' ;
908 $checked { 'IDENT_ENABLE_ACL' }{ $proxysettings { 'IDENT_ENABLE_ACL' }} = "checked='checked'" ;
910 $checked { 'IDENT_USER_ACL' }{ 'positive' } = '' ;
911 $checked { 'IDENT_USER_ACL' }{ 'negative' } = '' ;
912 $checked { 'IDENT_USER_ACL' }{ $proxysettings { 'IDENT_USER_ACL' }} = "checked='checked'" ;
914 $checked { 'ENABLE_FILTER' }{ 'off' } = '' ;
915 $checked { 'ENABLE_FILTER' }{ 'on' } = '' ;
916 $checked { 'ENABLE_FILTER' }{ $proxysettings { 'ENABLE_FILTER' }} = "checked='checked'" ;
918 $checked { 'ENABLE_UPDXLRATOR' }{ 'off' } = '' ;
919 $checked { 'ENABLE_UPDXLRATOR' }{ 'on' } = '' ;
920 $checked { 'ENABLE_UPDXLRATOR' }{ $proxysettings { 'ENABLE_UPDXLRATOR' }} = "checked='checked'" ;
922 $checked { 'ENABLE_CLAMAV' }{ 'off' } = '' ;
923 $checked { 'ENABLE_CLAMAV' }{ 'on' } = '' ;
924 $checked { 'ENABLE_CLAMAV' }{ $proxysettings { 'ENABLE_CLAMAV' }} = "checked='checked'" ;
926 & Header
:: openpage
( $Lang :: tr
{ 'advproxy advanced web proxy configuration' }, 1 , '' );
928 & Header
:: openbigbox
( '100%' , 'left' , '' , $errormessage );
931 & Header
:: openbox
( '100%' , 'left' , $Lang :: tr
{ 'error messages' });
932 print "<font class='base'> $errormessage </font> \n " ;
936 if ( $squidversion [ 0 ] =~ /^Squid\sCache:\sVersion\s/i )
938 $squidversion [ 0 ] =~ s/^Squid\sCache:\sVersion//i ;
939 $squidversion [ 0 ] =~ s/^\s+//g ;
940 $squidversion [ 0 ] =~ s/\s+$//g ;
942 $squidversion [ 0 ] = $Lang :: tr
{ 'advproxy unknown' };
945 # ===================================================================
947 # ===================================================================
949 unless ( $proxysettings { 'NCSA_EDIT_MODE' } eq 'yes' ) {
951 print "<form method='post' action=' $ENV {'SCRIPT_NAME'}'> \n " ;
953 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy advanced web proxy'}" );
958 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy common settings'}</b></td>
961 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled on'} <font color=" $Header ::colourgreen">Green</font>:</td>
962 <td width='20%'><input type='checkbox' name='ENABLE' $checked {'ENABLE'}{'on'} /></td>
963 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port'}:</td>
964 <td width='30%'><input type='text' name='PROXY_PORT' value=' $proxysettings {'PROXY_PORT'}' size='5' /></td>
967 <td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=" $Header ::colourgreen">Green</font>:</td>
968 <td><input type='checkbox' name='TRANSPARENT' $checked {'TRANSPARENT'}{'on'} /></td>
969 <td width='25%' class='base'> $Lang ::tr{'advproxy proxy port transparent'}:</td>
970 <td width='30%'><input type='text' name='TRANSPARENT_PORT' value=' $proxysettings {'TRANSPARENT_PORT'}' size='5' /></td>
975 if ( $netsettings { 'BLUE_DEV' }) {
976 print "<td class='base'> $Lang ::tr{'advproxy enabled on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
977 print "<td><input type='checkbox' name='ENABLE_BLUE' $checked {'ENABLE_BLUE'}{'on'} /></td>" ;
979 print "<td colspan='2'> </td>" ;
982 <td class='base'> $Lang ::tr{'advproxy visible hostname'}: <img src='/blob.gif' alt='*' /></td>
983 <td><input type='text' name='VISIBLE_HOSTNAME' value=' $proxysettings {'VISIBLE_HOSTNAME'}' /></td>
988 if ( $netsettings { 'BLUE_DEV' }) {
989 print "<td class='base'> $Lang ::tr{'advproxy transparent on'} <font color=' $Header ::colourblue'>Blue</font>:</td>" ;
990 print "<td><input type='checkbox' name='TRANSPARENT_BLUE' $checked {'TRANSPARENT_BLUE'}{'on'} /></td>" ;
992 print "<td colspan='2'> </td>" ;
995 <td class='base'> $Lang ::tr{'advproxy error language'}:</td>
997 <select name='ERR_LANGUAGE'>
1000 foreach (< $errordir /*>) {
1002 $language = substr ( $_ , rindex ( $_ , "/" )+ 1 );
1003 print "<option value=' $language ' $selected {'ERR_LANGUAGE'}{ $language }> $language </option> \n " ;
1011 <td class='base'> $Lang ::tr{'advproxy suppress version'}:</td>
1012 <td><input type='checkbox' name='SUPPRESS_VERSION' $checked {'SUPPRESS_VERSION'}{'on'} /></td>
1013 <td class='base'> $Lang ::tr{'advproxy error design'}:</td>
1014 <td class='base'><select name='ERR_DESIGN'>
1015 <option value='ipfire' $selected {'ERR_DESIGN'}{'ipfire'}>IPFire</option>
1016 <option value='squid' $selected {'ERR_DESIGN'}{'squid'}> $Lang ::tr{'advproxy standard'}</option>
1020 <td class='base'> $Lang ::tr{'advproxy squid version'}:</td>
1021 <td class='base'> [<font color=' $Header ::colourred'> $squidversion [0] </font>]</td>
1027 <table width='100%'>
1028 <tr><td class='base' colspan='4'><b> $Lang ::tr{'advproxy redirector children'}</b></td></tr>
1029 <tr><td class='base' > $Lang ::tr{'processes'}<input type='text' name='CHILDREN' value=' $proxysettings {'CHILDREN'}' size='5' /></td>
1032 my $count = `ip n| wc -l` ;
1033 if ( $count < 1 ){ $count = 1 ;}
1034 if ( - e
"/usr/bin/squidclamav" ) {
1035 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy squidclamav' }. "</b><br />" ;
1036 if ( ! - e
"/var/run/clamav/clamd.pid" ){
1037 print "<font color='red'>clamav not running</font><br /><br />" ;
1038 $proxysettings { 'ENABLE_CLAMAV' } = 'off' ;
1041 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_CLAMAV' ".$checked{'ENABLE_CLAMAV'}{'on'} . " /><br />" ;
1042 print "+ " . int (( $count **( 1 / 3 )) * 8 );}
1047 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy url filter' }. "</b><br />" ;
1048 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_FILTER' ".$checked{'ENABLE_FILTER'}{'on'} . " /><br />" ;
1049 print "+ " . int (( $count **( 1 / 3 )) * 6 );
1051 print "<td class='base'><b>" . $Lang :: tr
{ 'advproxy update accelerator' }. "</b><br />" ;
1052 print $Lang :: tr{'advproxy enabled'}."<input type='checkbox' name='ENABLE_UPDXLRATOR' ".$checked{'ENABLE_UPDXLRATOR'}{'on'} . " /><br />" ;
1053 print "+ " . int (( $count **( 1 / 3 )) * 5 );
1058 <table width='100%'>
1060 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy upstream proxy'}</b></td>
1063 <td width='25%' class='base'> $Lang ::tr{'advproxy via forwarding'}:</td>
1064 <td width='20%'><input type='checkbox' name='FORWARD_VIA' $checked {'FORWARD_VIA'}{'on'} /></td>
1065 <td width='25%' class='base'> $Lang ::tr{'advproxy upstream proxy host:port'} <img src='/blob.gif' alt='*' /></td>
1066 <td width='30%'><input type='text' name='UPSTREAM_PROXY' value=' $proxysettings {'UPSTREAM_PROXY'}' /></td>
1069 <td class='base'> $Lang ::tr{'advproxy client IP forwarding'}:</td>
1070 <td><input type='checkbox' name='FORWARD_IPADDRESS' $checked {'FORWARD_IPADDRESS'}{'on'} /></td>
1071 <td class='base'> $Lang ::tr{'advproxy upstream username'}: <img src='/blob.gif' alt='*' /></td>
1072 <td><input type='text' name='UPSTREAM_USER' value=' $proxysettings {'UPSTREAM_USER'}' /></td>
1075 <td class='base'> $Lang ::tr{'advproxy username forwarding'}:</td>
1076 <td><input type='checkbox' name='FORWARD_USERNAME' $checked {'FORWARD_USERNAME'}{'on'} /></td>
1077 <td class='base'> $Lang ::tr{'advproxy upstream password'}: <img src='/blob.gif' alt='*' /></td>
1078 <td><input type='password' name='UPSTREAM_PASSWORD' value=' $proxysettings {'UPSTREAM_PASSWORD'}' /></td>
1081 <td class='base'> $Lang ::tr{'advproxy no connection auth'}:</td>
1082 <td><input type='checkbox' name='NO_CONNECTION_AUTH' $checked {'NO_CONNECTION_AUTH'}{'on'} /></td>
1088 <table width='100%'>
1090 <td colspan='4' class='base'><b> $Lang ::tr{'advproxy log settings'}</b></td>
1093 <td width='25%' class='base'> $Lang ::tr{'advproxy log enabled'}:</td>
1094 <td width='20%'><input type='checkbox' name='LOGGING' $checked {'LOGGING'}{'on'} /></td>
1095 <td width='25%'class='base'> $Lang ::tr{'advproxy log query'}:</td>
1096 <td width='30%'><input type='checkbox' name='LOGQUERY' $checked {'LOGQUERY'}{'on'} /></td>
1101 <td class='base'> $Lang ::tr{'advproxy log useragent'}:</td>
1102 <td><input type='checkbox' name='LOGUSERAGENT' $checked {'LOGUSERAGENT'}{'on'} /></td>
1106 <table width='100%'>
1108 <td colspan='4'><b> $Lang ::tr{'advproxy cache management'}</b></td>
1111 <td class='base'> $Lang ::tr{'proxy cachemgr'}:</td>
1112 <td><input type='checkbox' name='CACHEMGR' $checked {'CACHEMGR'}{'on'} /></td>
1113 <td class='base'> $Lang ::tr{'advproxy admin mail'}: <img src='/blob.gif' alt='*' /></td>
1114 <td><input type='text' name='ADMIN_MAIL_ADDRESS' value=' $proxysettings {'ADMIN_MAIL_ADDRESS'}' /></td>
1117 <td class='base'> $Lang ::tr{'proxy filedescriptors'}:</td>
1118 <td><input type='text' name='FILEDESCRIPTORS' value=' $proxysettings {'FILEDESCRIPTORS'}' size='5' /></td>
1119 <td class='base'> $Lang ::tr{'proxy admin password'}: <img src='/blob.gif' alt='*' /></td>
1120 <td><input type='text' name='ADMIN_PASSWORD' value=' $proxysettings {'ADMIN_PASSWORD'}' /></td>
1123 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1126 <td class='base'> $Lang ::tr{'advproxy ram cache size'}:</td>
1127 <td><input type='text' name='CACHE_MEM' value=' $proxysettings {'CACHE_MEM'}' size='5' /></td>
1128 <td class='base'> $Lang ::tr{'advproxy hdd cache size'}:</td>
1129 <td><input type='text' name='CACHE_SIZE' value=' $proxysettings {'CACHE_SIZE'}' size='5' /></td>
1132 <td class='base'> $Lang ::tr{'advproxy min size'}:</td>
1133 <td><input type='text' name='MIN_SIZE' value=' $proxysettings {'MIN_SIZE'}' size='5' /></td>
1134 <td class='base'> $Lang ::tr{'advproxy max size'}:</td>
1135 <td><input type='text' name='MAX_SIZE' value=' $proxysettings {'MAX_SIZE'}' size='5' /></td>
1138 <td class='base'> $Lang ::tr{'advproxy number of L1 dirs'}:</td>
1139 <td class='base'><select name='L1_DIRS'>
1140 <option value='16' $selected {'L1_DIRS'}{'16'}>16</option>
1141 <option value='32' $selected {'L1_DIRS'}{'32'}>32</option>
1142 <option value='64' $selected {'L1_DIRS'}{'64'}>64</option>
1143 <option value='128' $selected {'L1_DIRS'}{'128'}>128</option>
1144 <option value='256' $selected {'L1_DIRS'}{'256'}>256</option>
1146 <td colspan='2' rowspan= '5' valign='top' class='base'>
1147 <table cellspacing='0' cellpadding='0'>
1149 <!-- intentionally left empty -->
1152 <td> $Lang ::tr{'advproxy no cache sites'}: <img src='/blob.gif' alt='*' /></td>
1155 <!-- intentionally left empty -->
1158 <!-- intentionally left empty -->
1161 <td><textarea name='DST_NOCACHE' cols='32' rows='6' wrap='off'>
1165 print $proxysettings { 'DST_NOCACHE' };
1174 <td class='base'> $Lang ::tr{'advproxy memory replacement policy'}:</td>
1175 <td class='base'><select name='MEM_POLICY'>
1176 <option value='LRU' $selected {'MEM_POLICY'}{'LRU'}>LRU</option>
1177 <option value='heap LFUDA' $selected {'MEM_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1178 <option value='heap GDSF' $selected {'MEM_POLICY'}{'heap GDSF'}>heap GDSF</option>
1179 <option value='heap LRU' $selected {'MEM_POLICY'}{'heap LRU'}>heap LRU</option>
1183 <td class='base'> $Lang ::tr{'advproxy cache replacement policy'}:</td>
1184 <td class='base'><select name='CACHE_POLICY'>
1185 <option value='LRU' $selected {'CACHE_POLICY'}{'LRU'}>LRU</option>
1186 <option value='heap LFUDA' $selected {'CACHE_POLICY'}{'heap LFUDA'}>heap LFUDA</option>
1187 <option value='heap GDSF' $selected {'CACHE_POLICY'}{'heap GDSF'}>heap GDSF</option>
1188 <option value='heap LRU' $selected {'CACHE_POLICY'}{'heap LRU'}>heap LRU</option>
1192 <td colspan='2'> </td>
1195 <td class='base'> $Lang ::tr{'advproxy offline mode'}:</td>
1196 <td><input type='checkbox' name='OFFLINE_MODE' $checked {'OFFLINE_MODE'}{'on'} /></td>
1199 <td class='base'> $Lang ::tr{'advproxy cache-digest'}:</td>
1200 <td><input type='checkbox' name='CACHE_DIGESTS' $checked {'CACHE_DIGESTS'}{'on'} /></td>
1204 <table width='100%'>
1206 <td colspan='4'><b> $Lang ::tr{'advproxy destination ports'}</b></td>
1209 <td width='25%' align='center'></td> <td width='20%' align='center'></td><td width='25%' align='center'></td><td width='30%' align='center'></td>
1212 <td colspan='2' class='base'> $Lang ::tr{'advproxy standard ports'}:</td>
1213 <td colspan='2' class='base'> $Lang ::tr{'advproxy ssl ports'}:</td>
1216 <td colspan='2'><textarea name='PORTS_SAFE' cols='32' rows='6' wrap='off'>
1219 if (! $proxysettings { 'PORTS_SAFE' }) { print $def_ports_safe ; } else { print $proxysettings { 'PORTS_SAFE' }; }
1223 <td colspan='2'><textarea name='PORTS_SSL' cols='32' rows='6' wrap='off'>
1226 if (! $proxysettings { 'PORTS_SSL' }) { print $def_ports_ssl ; } else { print $proxysettings { 'PORTS_SSL' }; }
1233 <table width='100%'>
1235 <td colspan='4'><b> $Lang ::tr{'advproxy network based access'}</b></td>
1238 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1241 <td colspan='4' class='base'> $Lang ::tr{'advproxy allowed subnets'}:</td>
1244 <td colspan='2' rowspan='4'><textarea name='SRC_SUBNETS' cols='32' rows='3' wrap='off'>
1248 if (! $proxysettings { 'SRC_SUBNETS' })
1250 print " $green_cidr \n " ;
1251 if ( $netsettings { 'BLUE_DEV' })
1253 print " $blue_cidr \n " ;
1255 } else { print $proxysettings { 'SRC_SUBNETS' }; }
1262 $line = $Lang :: tr
{ 'advproxy no internal proxy on green' };
1263 $line =~ s/Green/<font color="$Header::colourgreen">Green<\/ font
>/ i
;
1264 print "<td class='base'> $line :</td> \n " ;
1266 <td><input type='checkbox' name='NO_PROXY_LOCAL' $checked {'NO_PROXY_LOCAL'}{'on'} /></td>
1270 if ( $netsettings { 'BLUE_DEV' }) {
1271 $line = $Lang :: tr
{ 'advproxy no internal proxy on blue' };
1272 $line =~ s/Blue/<font color="$Header::colourblue">Blue<\/ font
>/ i
;
1274 print "<td class='base'> $line :</td> \n " ;
1276 <td><input type='checkbox' name='NO_PROXY_LOCAL_BLUE' $checked {'NO_PROXY_LOCAL_BLUE'}{'on'} /></td>
1283 <td colspan='2'> </td>
1286 <td colspan='2'> </td>
1289 <table width='100%'>
1291 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1294 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted ip clients'}: <img src='/blob.gif' alt='*' /></td>
1295 <td colspan='2' class='base'> $Lang ::tr{'advproxy unrestricted mac clients'}: <img src='/blob.gif' alt='*' /></td>
1298 <td colspan='2'><textarea name='SRC_UNRESTRICTED_IP' cols='32' rows='3' wrap='off'>
1302 print $proxysettings { 'SRC_UNRESTRICTED_IP' };
1306 <td colspan='2'><textarea name='SRC_UNRESTRICTED_MAC' cols='32' rows='3' wrap='off'>
1310 print $proxysettings { 'SRC_UNRESTRICTED_MAC' };
1316 <table width='100%'>
1318 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1321 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned ip clients'}: <img src='/blob.gif' alt='*' /></td>
1322 <td colspan='2' class='base'> $Lang ::tr{'advproxy banned mac clients'}: <img src='/blob.gif' alt='*' /></td>
1325 <td colspan='2'><textarea name='SRC_BANNED_IP' cols='32' rows='3' wrap='off'>
1329 print $proxysettings { 'SRC_BANNED_IP' };
1333 <td colspan='2'><textarea name='SRC_BANNED_MAC' cols='32' rows='3' wrap='off'>
1337 print $proxysettings { 'SRC_BANNED_MAC' };
1348 # -------------------------------------------------------------------
1349 # CRE GUI - optional
1350 # -------------------------------------------------------------------
1352 if (- e
$cre_enabled ) { print <<END
1353 <table width='100%'>
1356 <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>
1359 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1365 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1367 <td class='base'> $Lang ::tr{'advproxy supervisor password'}: <img src='/blob.gif' alt='*' /></td>
1368 <td><input type='password' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' size='12' /></td>
1371 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre group definitions'}:</td>
1372 <td colspan='2' class='base'> $Lang ::tr{'advproxy cre supervisors'}: <img src='/blob.gif' alt='*' /></td>
1377 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ){
1380 <td colspan='2'><textarea name='CRE_GROUPS' cols='32' rows='6' wrap='off'>
1384 print $proxysettings { 'CRE_GROUPS' };
1388 <td colspan='2'><textarea name='CRE_SVHOSTS' cols='32' rows='6' wrap='off'>
1391 print $proxysettings { 'CRE_SVHOSTS' };
1399 print "</table><hr size='1'>" ;
1403 <input type='hidden' name='SUPERVISOR_PASSWORD' value=' $proxysettings {'SUPERVISOR_PASSWORD'}' />
1404 <input type='hidden' name='CRE_GROUPS' value=' $proxysettings {'CRE_GROUPS'}' />
1405 <input type='hidden' name='CRE_SVHOSTS' value=' $proxysettings {'CRE_SVHOSTS'}' />
1410 # -------------------------------------------------------------------
1414 <table width='100%'>
1416 <td colspan='4'><b> $Lang ::tr{'advproxy time restrictions'}</b></td>
1418 <table width='100%'>
1420 <td width='2%'> $Lang ::tr{'advproxy access'}</td>
1421 <td width='1%'> </td>
1422 <td width='2%' align='center'> $Lang ::tr{'advproxy monday'}</td>
1423 <td width='2%' align='center'> $Lang ::tr{'advproxy tuesday'}</td>
1424 <td width='2%' align='center'> $Lang ::tr{'advproxy wednesday'}</td>
1425 <td width='2%' align='center'> $Lang ::tr{'advproxy thursday'}</td>
1426 <td width='2%' align='center'> $Lang ::tr{'advproxy friday'}</td>
1427 <td width='2%' align='center'> $Lang ::tr{'advproxy saturday'}</td>
1428 <td width='2%' align='center'> $Lang ::tr{'advproxy sunday'}</td>
1429 <td width='1%'> </td>
1430 <td width='7%' colspan=3> $Lang ::tr{'advproxy from'}</td>
1431 <td width='1%'> </td>
1432 <td width='7%' colspan=3> $Lang ::tr{'advproxy to'}</td>
1437 <select name='TIME_ACCESS_MODE'>
1438 <option value='allow' $selected {'TIME_ACCESS_MODE'}{'allow'}> $Lang ::tr{'advproxy mode allow'}</option>
1439 <option value='deny' $selected {'TIME_ACCESS_MODE'}{'deny'}> $Lang ::tr{'advproxy mode deny'}</option>
1443 <td class='base'><input type='checkbox' name='TIME_MON' $checked {'TIME_MON'}{'on'} /></td>
1444 <td class='base'><input type='checkbox' name='TIME_TUE' $checked {'TIME_TUE'}{'on'} /></td>
1445 <td class='base'><input type='checkbox' name='TIME_WED' $checked {'TIME_WED'}{'on'} /></td>
1446 <td class='base'><input type='checkbox' name='TIME_THU' $checked {'TIME_THU'}{'on'} /></td>
1447 <td class='base'><input type='checkbox' name='TIME_FRI' $checked {'TIME_FRI'}{'on'} /></td>
1448 <td class='base'><input type='checkbox' name='TIME_SAT' $checked {'TIME_SAT'}{'on'} /></td>
1449 <td class='base'><input type='checkbox' name='TIME_SUN' $checked {'TIME_SUN'}{'on'} /></td>
1452 <select name='TIME_FROM_HOUR'>
1455 for ( $i = 0 ; $i <= 24 ; $i ++) {
1456 $_ = sprintf ( " %02s " , $i );
1457 print "<option $selected {'TIME_FROM_HOUR'}{ $_ }> $_ </option> \n " ;
1464 <select name='TIME_FROM_MINUTE'>
1467 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1468 $_ = sprintf ( " %02s " , $i );
1469 print "<option $selected {'TIME_FROM_MINUTE'}{ $_ }> $_ </option> \n " ;
1476 <select name='TIME_TO_HOUR'>
1479 for ( $i = 0 ; $i <= 24 ; $i ++) {
1480 $_ = sprintf ( " %02s " , $i );
1481 print "<option $selected {'TIME_TO_HOUR'}{ $_ }> $_ </option> \n " ;
1488 <select name='TIME_TO_MINUTE'>
1491 for ( $i = 0 ; $i <= 45 ; $i += 15 ) {
1492 $_ = sprintf ( " %02s " , $i );
1493 print "<option $selected {'TIME_TO_MINUTE'}{ $_ }> $_ </option> \n " ;
1501 <table width='100%'>
1503 <td colspan='4'><b> $Lang ::tr{'advproxy transfer limits'}</b></td>
1506 <td width='25%' class='base'> $Lang ::tr{'advproxy max download size'}:</td>
1507 <td width='20%'><input type='text' name='MAX_INCOMING_SIZE' value=' $proxysettings {'MAX_INCOMING_SIZE'}' size='5' /></td>
1508 <td width='25%' class='base'> $Lang ::tr{'advproxy max upload size'}:</td>
1509 <td width='30%'><input type='text' name='MAX_OUTGOING_SIZE' value=' $proxysettings {'MAX_OUTGOING_SIZE'}' size='5' /></td>
1513 <table width='100%'>
1515 <td colspan='4'><b> $Lang ::tr{'advproxy download throttling'}</b></td>
1518 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1519 <td width='20%' class='base'>
1520 <select name='THROTTLING_GREEN_TOTAL'>
1524 foreach ( @throttle_limits ) {
1525 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1529 <option value='0' $selected {'THROTTLING_GREEN_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1532 <td width='25%' class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourgreen">Green</font>:</td>
1533 <td width='30%' class='base'>
1534 <select name='THROTTLING_GREEN_HOST'>
1538 foreach ( @throttle_limits ) {
1539 print " \t <option value=' $_ ' $selected {'THROTTLING_GREEN_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1543 <option value='0' $selected {'THROTTLING_GREEN_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1550 if ( $netsettings { 'BLUE_DEV' }) {
1553 <td class='base'> $Lang ::tr{'advproxy throttling total on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1555 <select name='THROTTLING_BLUE_TOTAL'>
1559 foreach ( @throttle_limits ) {
1560 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_TOTAL'}{ $_ }> $_ kBit/s</option> \n " ;
1564 <option value='0' $selected {'THROTTLING_BLUE_TOTAL'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1567 <td class='base'> $Lang ::tr{'advproxy throttling per host on'} <font color=" $Header ::colourblue">Blue</font>:</td>
1569 <select name='THROTTLING_BLUE_HOST'>
1573 foreach ( @throttle_limits ) {
1574 print " \t <option value=' $_ ' $selected {'THROTTLING_BLUE_HOST'}{ $_ }> $_ kBit/s</option> \n " ;
1578 <option value='0' $selected {'THROTTLING_BLUE_HOST'}{'unlimited'}> $Lang ::tr{'advproxy throttling unlimited'}</option> \n ";
1588 <table width='100%'>
1590 <td colspan='4'><i> $Lang ::tr{'advproxy content based throttling'}:</i></td>
1593 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle binary'}:</td>
1594 <td width='10%'><input type='checkbox' name='THROTTLE_BINARY' $checked {'THROTTLE_BINARY'}{'on'} /></td>
1595 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle dskimg'}:</td>
1596 <td width='10%'><input type='checkbox' name='THROTTLE_DSKIMG' $checked {'THROTTLE_DSKIMG'}{'on'} /></td>
1597 <td width='15%' class='base'> $Lang ::tr{'advproxy throttle mmedia'}:</td>
1598 <td width='10%'><input type='checkbox' name='THROTTLE_MMEDIA' $checked {'THROTTLE_MMEDIA'}{'on'} /></td>
1599 <td width='15%'> </td>
1600 <td width='10%'> </td>
1604 <table width='100%'>
1606 <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>
1610 if ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' ){
1613 <td colspan='2' class='base'> $Lang ::tr{'advproxy MIME block types'}: <img src='/blob.gif' alt='*' /></td>
1618 <td colspan='2'><textarea name='MIME_TYPES' cols='32' rows='6' wrap='off'>
1622 print $proxysettings { 'MIME_TYPES' };
1636 <table width='100%'>
1638 <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>
1642 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ){
1648 if ( @useragentlist ) { print " $Lang ::tr{'advproxy allowed web browsers'}:" ; } else { print " $Lang ::tr{'advproxy no clients defined'}" ; }
1653 <table width='100%'>
1657 for ( $n = 0 ; $n <= @useragentlist ; $n = $n + $i ) {
1658 for ( $i = 0 ; $i <= 3 ; $i ++) {
1659 if ( $i eq 0 ) { print "<tr> \n " ; }
1660 if (( $n + $i ) < @useragentlist ) {
1661 @useragent = split ( /,/ , @useragentlist [ $n + $i ]);
1662 print "<td width='15%'> $useragent [1]:<\/td> \n " ;
1663 print "<td width='10%'><input type='checkbox' name='UA_ $useragent [0]' $checked {'UA_'. $useragent [0]}{'on'} /></td> \n " ;
1665 if ( $i eq 3 ) { print "<\/tr> \n " ; }
1672 <table width='100%'>
1674 <td><b> $Lang ::tr{'advproxy privacy'}</b></td>
1677 <td class='base'> $Lang ::tr{'advproxy fake useragent'}: <img src='/blob.gif' alt='*' /></td>
1678 <td class='base'> $Lang ::tr{'advproxy fake referer'}: <img src='/blob.gif' alt='*' /></td>
1681 <td><input type='text' name='FAKE_USERAGENT' value=' $proxysettings {'FAKE_USERAGENT'}' size='40%' /></td>
1682 <td><input type='text' name='FAKE_REFERER' value=' $proxysettings {'FAKE_REFERER'}' size='40%' /></td>
1690 <table width='100%'>
1692 <td colspan='5'><b> $Lang ::tr{'advproxy AUTH method'}</b></td>
1695 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='none' $checked {'AUTH_METHOD'}{'none'} /> $Lang ::tr{'advproxy AUTH method none'}</td>
1696 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ncsa' $checked {'AUTH_METHOD'}{'ncsa'} /> $Lang ::tr{'advproxy AUTH method ncsa'}</td>
1697 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ident' $checked {'AUTH_METHOD'}{'ident'} /> $Lang ::tr{'advproxy AUTH method ident'}</td>
1698 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ldap' $checked {'AUTH_METHOD'}{'ldap'} /> $Lang ::tr{'advproxy AUTH method ldap'}</td>
1699 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='ntlm' $checked {'AUTH_METHOD'}{'ntlm'} /> $Lang ::tr{'advproxy AUTH method ntlm'}</td>
1700 <td width='16%' class='base'><input type='radio' name='AUTH_METHOD' value='radius' $checked {'AUTH_METHOD'}{'radius'} /> $Lang ::tr{'advproxy AUTH method radius'}</td>
1706 if (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) { if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) { print <<END
1708 <table width='100%'>
1710 <td colspan='4'><b> $Lang ::tr{'advproxy AUTH global settings'}</b></td>
1713 <td width='25%'></td> <td width='20%'> </td><td width='25%'> </td><td width='30%'></td>
1716 <td class='base'> $Lang ::tr{'advproxy AUTH number of auth processes'}:</td>
1717 <td><input type='text' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}' size='5' /></td>
1718 <td colspan='2' rowspan= '6' valign='top' class='base'>
1719 <table cellpadding='0' cellspacing='0'>
1721 <td class='base'> $Lang ::tr{'advproxy AUTH realm'}: <img src='/blob.gif' alt='*' /></td>
1724 <!-- intentionally left empty -->
1727 <!-- intentionally left empty -->
1730 <td><input type='text' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}' size='40' /></td>
1733 <!-- intentionally left empty -->
1736 <!-- intentionally left empty -->
1739 <td> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1742 <!-- intentionally left empty -->
1745 <!-- intentionally left empty -->
1748 <td><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1752 print $proxysettings { 'DST_NOAUTH' };
1761 <td class='base'> $Lang ::tr{'advproxy AUTH auth cache TTL'}:</td>
1762 <td><input type='text' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
1765 <td class='base'> $Lang ::tr{'advproxy AUTH limit of IP addresses'}: <img src='/blob.gif' alt='*' /></td>
1766 <td><input type='text' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
1769 <td class='base'> $Lang ::tr{'advproxy AUTH user IP cache TTL'}:</td>
1770 <td><input type='text' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
1773 <td class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1774 <td><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1777 <td colspan='2'> </td>
1784 # ===================================================================
1785 # NCSA auth settings
1786 # ===================================================================
1788 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) {
1791 <table width='100%'>
1793 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA auth'}</b></td>
1796 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA min password length'}:</td>
1797 <td width='20%'><input type='text' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}' size='5' /></td>
1798 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA redirector bypass'} \' $Lang ::tr{'advproxy NCSA grp extended'} \' :</td>
1799 <td width='20%'><input type='checkbox' name='NCSA_BYPASS_REDIR' $checked {'NCSA_BYPASS_REDIR'}{'on'} /></td>
1802 <td colspan='2'><br> <input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy NCSA user management'}'></td>
1810 # ===================================================================
1811 # IDENTD auth settings
1812 # ===================================================================
1814 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
1817 <table width='100%'>
1819 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT identd settings'}</b></td>
1822 <td width='25%' class='base'> $Lang ::tr{'advproxy IDENT required'}:</td>
1823 <td width='20%'><input type='checkbox' name='IDENT_REQUIRED' $checked {'IDENT_REQUIRED'}{'on'} /></td>
1824 <td width='25%' class='base'> $Lang ::tr{'advproxy AUTH always required'}:</td>
1825 <td width='30%'><input type='checkbox' name='AUTH_ALWAYS_REQUIRED' $checked {'AUTH_ALWAYS_REQUIRED'}{'on'} /></td>
1828 <td class='base'> $Lang ::tr{'advproxy IDENT timeout'}:</td>
1829 <td><input type='text' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}' size='5' /></td>
1834 <td colspan='2' class='base'> $Lang ::tr{'advproxy IDENT aware hosts'}:</td>
1835 <td colspan='2' class='base'> $Lang ::tr{'advproxy AUTH no auth'}: <img src='/blob.gif' alt='*' /></td>
1838 <td colspan='2'><textarea name='IDENT_HOSTS' cols='32' rows='6' wrap='off'>
1841 if (! $proxysettings { 'IDENT_HOSTS' }) {
1842 print " $green_cidr \n " ;
1843 if ( $netsettings { 'BLUE_DEV' }) {
1844 print " $blue_cidr \n " ;
1847 print $proxysettings { 'IDENT_HOSTS' };
1852 <td colspan='2'><textarea name='DST_NOAUTH' cols='32' rows='6' wrap='off'>
1856 print $proxysettings { 'DST_NOAUTH' };
1863 <table width='100%'>
1865 <td colspan='4'><b> $Lang ::tr{'advproxy IDENT user based access restrictions'}</b></td>
1868 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1869 <td width='20%'><input type='checkbox' name='IDENT_ENABLE_ACL' $checked {'IDENT_ENABLE_ACL'}{'on'} /></td>
1870 <td width='25%'> </td>
1871 <td width='30%'> </td>
1874 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='positive' $checked {'IDENT_USER_ACL'}{'positive'} />
1875 $Lang ::tr{'advproxy IDENT use positive access list'}:</td>
1876 <td colspan='2'><input type='radio' name='IDENT_USER_ACL' value='negative' $checked {'IDENT_USER_ACL'}{'negative'} />
1877 $Lang ::tr{'advproxy IDENT use negative access list'}:</td>
1880 <td colspan='2'> $Lang ::tr{'advproxy IDENT authorized users'}</td>
1881 <td colspan='2'> $Lang ::tr{'advproxy IDENT unauthorized users'}</td>
1884 <td colspan='2'><textarea name='IDENT_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1888 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_ALLOW_USERS' }; }
1890 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1892 <td colspan='2'><textarea name='IDENT_DENY_USERS' cols='32' rows='6' wrap='off'>
1896 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print $proxysettings { 'IDENT_DENY_USERS' }; }
1898 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) { print <<END
1905 # ===================================================================
1906 # NTLM auth settings
1907 # ===================================================================
1909 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) {
1912 <table width='100%'>
1914 <td colspan='6'><b> $Lang ::tr{'advproxy NTLM domain settings'}</b></td>
1917 <td class='base'> $Lang ::tr{'advproxy NTLM domain'}:</td>
1918 <td><input type='text' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}' size='15' /></td>
1919 <td class='base'> $Lang ::tr{'advproxy NTLM PDC hostname'}:</td>
1920 <td><input type='text' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}' size='14' /></td>
1921 <td class='base'> $Lang ::tr{'advproxy NTLM BDC hostname'}: <img src='/blob.gif' alt='*' /></td>
1922 <td><input type='text' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}' size='14' /></td>
1926 <table width='100%'>
1928 <td colspan='3'><b> $Lang ::tr{'advproxy NTLM auth mode'}</b></td>
1931 <td width='25%' class='base' width='25%'> $Lang ::tr{'advproxy NTLM use integrated auth'}:</td>
1932 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_INT_AUTH' $checked {'NTLM_ENABLE_INT_AUTH'}{'on'} /></td>
1937 <table width='100%'>
1939 <td colspan='4'><b> $Lang ::tr{'advproxy NTLM user based access restrictions'}</b></td>
1942 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
1943 <td width='20%'><input type='checkbox' name='NTLM_ENABLE_ACL' $checked {'NTLM_ENABLE_ACL'}{'on'} /></td>
1944 <td width='25%'> </td>
1945 <td width='30%'> </td>
1948 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='positive' $checked {'NTLM_USER_ACL'}{'positive'} />
1949 $Lang ::tr{'advproxy NTLM use positive access list'}:</td>
1950 <td colspan='2'><input type='radio' name='NTLM_USER_ACL' value='negative' $checked {'NTLM_USER_ACL'}{'negative'} />
1951 $Lang ::tr{'advproxy NTLM use negative access list'}:</td>
1954 <td colspan='2'> $Lang ::tr{'advproxy NTLM authorized users'}</td>
1955 <td colspan='2'> $Lang ::tr{'advproxy NTLM unauthorized users'}</td>
1958 <td colspan='2'><textarea name='NTLM_ALLOW_USERS' cols='32' rows='6' wrap='off'>
1962 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_ALLOW_USERS' }; }
1964 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1966 <td colspan='2'><textarea name='NTLM_DENY_USERS' cols='32' rows='6' wrap='off'>
1970 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print $proxysettings { 'NTLM_DENY_USERS' }; }
1972 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) { print <<END
1979 # ===================================================================
1980 # LDAP auth settings
1981 # ===================================================================
1983 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) {
1986 <table width='100%'>
1988 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP common settings'}</b></td>
1991 <td class='base'> $Lang ::tr{'advproxy LDAP basedn'}:</td>
1992 <td><input type='text' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}' size='37' /></td>
1993 <td class='base'> $Lang ::tr{'advproxy LDAP type'}:</td>
1994 <td class='base'><select name='LDAP_TYPE'>
1995 <option value='ADS' $selected {'LDAP_TYPE'}{'ADS'}> $Lang ::tr{'advproxy LDAP ADS'}</option>
1996 <option value='NDS' $selected {'LDAP_TYPE'}{'NDS'}> $Lang ::tr{'advproxy LDAP NDS'}</option>
1997 <option value='V2' $selected {'LDAP_TYPE'}{'V2'}> $Lang ::tr{'advproxy LDAP V2'}</option>
1998 <option value='V3' $selected {'LDAP_TYPE'}{'V3'}> $Lang ::tr{'advproxy LDAP V3'}</option>
2002 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP server'}:</td>
2003 <td width='40%'><input type='text' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}' size='14' /></td>
2004 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP port'}:</td>
2005 <td><input type='text' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}' size='3' /></td>
2009 <table width='100%'>
2011 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP binddn settings'}</b></td>
2014 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn username'}:</td>
2015 <td width='40%'><input type='text' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}' size='37' /></td>
2016 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP binddn password'}:</td>
2017 <td><input type='password' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}' size='14' /></td>
2021 <table width='100%'>
2023 <td colspan='4'><b> $Lang ::tr{'advproxy LDAP group access control'}</b></td>
2026 <td width='20%' class='base'> $Lang ::tr{'advproxy LDAP group required'}: <img src='/blob.gif' alt='*' /></td>
2027 <td width='40%'><input type='text' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}' size='37' /></td>
2035 # ===================================================================
2036 # RADIUS auth settings
2037 # ===================================================================
2039 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) {
2042 <table width='100%'>
2044 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS radius settings'}</b></td>
2047 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS server'}:</td>
2048 <td width='20%'><input type='text' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}' size='14' /></td>
2049 <td width='25%' class='base'> $Lang ::tr{'advproxy RADIUS port'}:</td>
2050 <td width='30%'><input type='text' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}' size='3' /></td>
2053 <td class='base'> $Lang ::tr{'advproxy RADIUS identifier'}: <img src='/blob.gif' alt='*' /></td>
2054 <td><input type='text' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}' size='14' /></td>
2055 <td class='base'> $Lang ::tr{'advproxy RADIUS secret'}:</td>
2056 <td><input type='password' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}' size='14' /></td>
2060 <table width='100%'>
2062 <td colspan='4'><b> $Lang ::tr{'advproxy RADIUS user based access restrictions'}</b></td>
2065 <td width='25%' class='base'> $Lang ::tr{'advproxy enabled'}:</td>
2066 <td width='20%'><input type='checkbox' name='RADIUS_ENABLE_ACL' $checked {'RADIUS_ENABLE_ACL'}{'on'} /></td>
2067 <td width='25%'> </td>
2068 <td width='30%'> </td>
2071 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='positive' $checked {'RADIUS_USER_ACL'}{'positive'} />
2072 $Lang ::tr{'advproxy RADIUS use positive access list'}:</td>
2073 <td colspan='2'><input type='radio' name='RADIUS_USER_ACL' value='negative' $checked {'RADIUS_USER_ACL'}{'negative'} />
2074 $Lang ::tr{'advproxy RADIUS use negative access list'}:</td>
2077 <td colspan='2'> $Lang ::tr{'advproxy RADIUS authorized users'}</td>
2078 <td colspan='2'> $Lang ::tr{'advproxy RADIUS unauthorized users'}</td>
2081 <td colspan='2'><textarea name='RADIUS_ALLOW_USERS' cols='32' rows='6' wrap='off'>
2085 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_ALLOW_USERS' }; }
2087 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
2089 <td colspan='2'><textarea name='RADIUS_DENY_USERS' cols='32' rows='6' wrap='off'>
2093 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print $proxysettings { 'RADIUS_DENY_USERS' }; }
2095 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) { print <<END
2102 # ===================================================================
2108 if ( $proxysettings { 'AUTH_METHOD' } eq 'none' ) {
2110 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2111 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2112 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2113 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
2114 <td><input type='hidden' name='AUTH_ALWAYS_REQUIRED' value=' $proxysettings {'AUTH_ALWAYS_REQUIRED'}'></td>
2115 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2116 <td><input type='hidden' name='DST_NOAUTH' value=' $proxysettings {'DST_NOAUTH'}'></td>
2120 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) {
2122 <td><input type='hidden' name='AUTH_CHILDREN' value=' $proxysettings {'AUTH_CHILDREN'}'></td>
2123 <td><input type='hidden' name='AUTH_CACHE_TTL' value=' $proxysettings {'AUTH_CACHE_TTL'}' size='5' /></td>
2124 <td><input type='hidden' name='AUTH_MAX_USERIP' value=' $proxysettings {'AUTH_MAX_USERIP'}' size='5' /></td>
2125 <td><input type='hidden' name='AUTH_IPCACHE_TTL' value=' $proxysettings {'AUTH_IPCACHE_TTL'}' size='5' /></td>
2126 <td><input type='hidden' name='AUTH_REALM' value=' $proxysettings {'AUTH_REALM'}'></td>
2130 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )) {
2132 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2133 <td><input type='hidden' name='NCSA_BYPASS_REDIR' value=' $proxysettings {'NCSA_BYPASS_REDIR'}'></td>
2137 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )) {
2139 <td><input type='hidden' name='IDENT_REQUIRED' value=' $proxysettings {'IDENT_REQUIRED'}'></td>
2140 <td><input type='hidden' name='IDENT_TIMEOUT' value=' $proxysettings {'IDENT_TIMEOUT'}'></td>
2141 <td><input type='hidden' name='IDENT_HOSTS' value=' $proxysettings {'IDENT_HOSTS'}'></td>
2142 <td><input type='hidden' name='IDENT_ENABLE_ACL' value=' $proxysettings {'IDENT_ENABLE_ACL'}'></td>
2143 <td><input type='hidden' name='IDENT_USER_ACL' value=' $proxysettings {'IDENT_USER_ACL'}'></td>
2144 <td><input type='hidden' name='IDENT_ALLOW_USERS' value=' $proxysettings {'IDENT_ALLOW_USERS'}'></td>
2145 <td><input type='hidden' name='IDENT_DENY_USERS' value=' $proxysettings {'IDENT_DENY_USERS'}'></td>
2149 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )) {
2151 <td><input type='hidden' name='LDAP_BASEDN' value=' $proxysettings {'LDAP_BASEDN'}'></td>
2152 <td><input type='hidden' name='LDAP_TYPE' value=' $proxysettings {'LDAP_TYPE'}'></td>
2153 <td><input type='hidden' name='LDAP_SERVER' value=' $proxysettings {'LDAP_SERVER'}'></td>
2154 <td><input type='hidden' name='LDAP_PORT' value=' $proxysettings {'LDAP_PORT'}'></td>
2155 <td><input type='hidden' name='LDAP_BINDDN_USER' value=' $proxysettings {'LDAP_BINDDN_USER'}'></td>
2156 <td><input type='hidden' name='LDAP_BINDDN_PASS' value=' $proxysettings {'LDAP_BINDDN_PASS'}'></td>
2157 <td><input type='hidden' name='LDAP_GROUP' value=' $proxysettings {'LDAP_GROUP'}'></td>
2161 if (!( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )) {
2163 <td><input type='hidden' name='NTLM_DOMAIN' value=' $proxysettings {'NTLM_DOMAIN'}'></td>
2164 <td><input type='hidden' name='NTLM_PDC' value=' $proxysettings {'NTLM_PDC'}'></td>
2165 <td><input type='hidden' name='NTLM_BDC' value=' $proxysettings {'NTLM_BDC'}'></td>
2166 <td><input type='hidden' name='NTLM_ENABLE_INT_AUTH' value=' $proxysettings {'NTLM_ENABLE_INT_AUTH'}'></td>
2167 <td><input type='hidden' name='NTLM_ENABLE_ACL' value=' $proxysettings {'NTLM_ENABLE_ACL'}'></td>
2168 <td><input type='hidden' name='NTLM_USER_ACL' value=' $proxysettings {'NTLM_USER_ACL'}'></td>
2169 <td><input type='hidden' name='NTLM_ALLOW_USERS' value=' $proxysettings {'NTLM_ALLOW_USERS'}'></td>
2170 <td><input type='hidden' name='NTLM_DENY_USERS' value=' $proxysettings {'NTLM_DENY_USERS'}'></td>
2174 if (!( $proxysettings { 'AUTH_METHOD' } eq 'radius' )) {
2176 <td><input type='hidden' name='RADIUS_SERVER' value=' $proxysettings {'RADIUS_SERVER'}'></td>
2177 <td><input type='hidden' name='RADIUS_PORT' value=' $proxysettings {'RADIUS_PORT'}'></td>
2178 <td><input type='hidden' name='RADIUS_IDENTIFIER' value=' $proxysettings {'RADIUS_IDENTIFIER'}'></td>
2179 <td><input type='hidden' name='RADIUS_SECRET' value=' $proxysettings {'RADIUS_SECRET'}'></td>
2180 <td><input type='hidden' name='RADIUS_ENABLE_ACL' value=' $proxysettings {'RADIUS_ENABLE_ACL'}'></td>
2181 <td><input type='hidden' name='RADIUS_USER_ACL' value=' $proxysettings {'RADIUS_USER_ACL'}'></td>
2182 <td><input type='hidden' name='RADIUS_ALLOW_USERS' value=' $proxysettings {'RADIUS_ALLOW_USERS'}'></td>
2183 <td><input type='hidden' name='RADIUS_DENY_USERS' value=' $proxysettings {'RADIUS_DENY_USERS'}'></td>
2195 <table width='100%'>
2198 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'save'}' /></td>
2199 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'proxy reconfigure'}' /></td>
2200 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy save and restart'}' /></td>
2201 <td align='center'><input type='submit' name='ACTION' value=' $Lang ::tr{'advproxy clear cache'}' /></td>
2207 <table width='100%'>
2209 <td><img src='/blob.gif' align='top' alt='*' />
2210 <font class='base'> $Lang ::tr{'this field may be blank'}</font>
2212 <td align='right'> </td>
2219 & Header
:: closebox
();
2223 # ===================================================================
2224 # NCSA user management
2225 # ===================================================================
2227 & Header
:: openbox
( '100%' , 'left' , " $Lang ::tr{'advproxy NCSA auth'}" );
2229 <form method='post' action=' $ENV {'SCRIPT_NAME'}'>
2230 <table width='100%'>
2232 <td colspan='4'><b> $Lang ::tr{'advproxy NCSA user management'}</b></td>
2235 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA username'}:</td>
2236 <td width='25%'><input type='text' name='NCSA_USERNAME' value=' $proxysettings {'NCSA_USERNAME'}' size='12'
2239 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) { print " readonly='readonly' " ; }
2242 <td width='25%' class='base'> $Lang ::tr{'advproxy NCSA group'}:</td>
2244 <select name='NCSA_GROUP'>
2245 <option value='standard' $selected {'NCSA_GROUP'}{'standard'}> $Lang ::tr{'advproxy NCSA grp standard'}</option>
2246 <option value='extended' $selected {'NCSA_GROUP'}{'extended'}> $Lang ::tr{'advproxy NCSA grp extended'}</option>
2247 <option value='disabled' $selected {'NCSA_GROUP'}{'disabled'}> $Lang ::tr{'advproxy NCSA grp disabled'}</option>
2253 <td class='base'> $Lang ::tr{'advproxy NCSA password'}:</td>
2254 <td><input type='password' name='NCSA_PASS' value=' $proxysettings {'NCSA_PASS'}' size='14' /></td>
2255 <td class='base'> $Lang ::tr{'advproxy NCSA password confirm'}:</td>
2256 <td><input type='password' name='NCSA_PASS_CONFIRM' value=' $proxysettings {'NCSA_PASS_CONFIRM'}' size='14' /></td>
2263 <td><input type='submit' name='SUBMIT' value=' $ncsa_buttontext ' /></td>
2264 <td><input type='hidden' name='ACTION' value=' $Lang ::tr{'add'}' /></td>
2265 <td><input type='hidden' name='NCSA_MIN_PASS_LEN' value=' $proxysettings {'NCSA_MIN_PASS_LEN'}'></td>
2268 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' }) {
2269 print "<td><input type='reset' name='ACTION' value=' $Lang ::tr{'advproxy reset'}' /></td> \n " ;
2275 <td><input type='button' name='return2main' value=' $Lang ::tr{'advproxy back to main page'}' onClick='self.location.href=" $ENV {'SCRIPT_NAME'}"'></td>
2280 <table width='100%'>
2282 <td><b> $Lang ::tr{'advproxy NCSA user accounts'}:</b></td>
2285 <table width='100%' align='center'>
2291 open ( FILE
, $extgrp ); @grouplist = < FILE
>; close ( FILE
);
2292 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":extended" ); }
2296 open ( FILE
, $stdgrp ); @grouplist = < FILE
>; close ( FILE
);
2297 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":standard" ); }
2301 open ( FILE
, $disgrp ); @grouplist = < FILE
>; close ( FILE
);
2302 foreach $user ( @grouplist ) { chomp ( $user ); push ( @userlist , $user . ":disabled" ); }
2305 @userlist = sort ( @userlist );
2307 # If the password file contains entries, print entries and action icons
2309 if ( ! - z
" $userdb " ) {
2312 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA username'}</i></b></td>
2313 <td width='30%' class='boldbase' align='center'><b><i> $Lang ::tr{'advproxy NCSA group membership'}</i></b></td>
2314 <td class='boldbase' colspan='2' align='center'> </td>
2319 foreach $line ( @userlist )
2323 @temp = split ( /:/ , $line );
2324 if ( $proxysettings { 'ACTION' } eq $Lang :: tr
{ 'edit' } && $proxysettings { 'ID' } eq $line ) {
2325 print "<tr bgcolor=' $Header ::colouryellow'> \n " ; }
2327 print "<tr bgcolor=' $color {'color20'}'> \n " ; }
2329 print "<tr bgcolor=' $color {'color22'}'> \n " ; }
2332 <td align='center'> $temp [0]</td>
2336 if ( $temp [ 1 ] eq 'standard' ) {
2337 print $Lang :: tr
{ 'advproxy NCSA grp standard' };
2338 } elsif ( $temp [ 1 ] eq 'extended' ) {
2339 print $Lang :: tr
{ 'advproxy NCSA grp extended' };
2340 } elsif ( $temp [ 1 ] eq 'disabled' ) {
2341 print $Lang :: tr
{ 'advproxy NCSA grp disabled' }; }
2344 <td width='8%' align='center'>
2345 <form method='post' name='frma $id ' action=' $ENV {'SCRIPT_NAME'}'>
2346 <input type='image' name=' $Lang ::tr{'edit'}' src='/images/edit.gif' title=' $Lang ::tr{'edit'}' alt=' $Lang ::tr{'edit'}' />
2347 <input type='hidden' name='ID' value=' $line ' />
2348 <input type='hidden' name='ACTION' value=' $Lang ::tr{'edit'}' />
2352 <td width='8%' align='center'>
2353 <form method='post' name='frmb $id ' action=' $ENV {'SCRIPT_NAME'}'>
2354 <input type='image' name=' $Lang ::tr{'remove'}' src='/images/delete.gif' title=' $Lang ::tr{'remove'}' alt=' $Lang ::tr{'remove'}' />
2355 <input type='hidden' name='ID' value=' $temp [0]' />
2356 <input type='hidden' name='ACTION' value=' $Lang ::tr{'remove'}' />
2369 <td class='boldbase'> <b> $Lang ::tr{'legend'}:</b></td>
2370 <td> <img src='/images/edit.gif' alt=' $Lang ::tr{'edit'}' /></td>
2371 <td class='base'> $Lang ::tr{'edit'}</td>
2372 <td> <img src='/images/delete.gif' alt=' $Lang ::tr{'remove'}' /></td>
2373 <td class='base'> $Lang ::tr{'remove'}</td>
2380 <td><i> $Lang ::tr{'advproxy NCSA no accounts'}</i></td>
2391 & Header
:: closebox
();
2395 # ===================================================================
2397 & Header
:: closebigbox
();
2399 & Header
:: closepage
();
2401 # -------------------------------------------------------------------
2405 if (- e
" $acl_src_subnets " ) {
2406 open ( FILE
, " $acl_src_subnets " );
2407 delete $proxysettings { 'SRC_SUBNETS' };
2408 while (< FILE
>) { $proxysettings { 'SRC_SUBNETS' } .= $_ };
2411 if (- e
" $acl_src_banned_ip " ) {
2412 open ( FILE
, " $acl_src_banned_ip " );
2413 delete $proxysettings { 'SRC_BANNED_IP' };
2414 while (< FILE
>) { $proxysettings { 'SRC_BANNED_IP' } .= $_ };
2417 if (- e
" $acl_src_banned_mac " ) {
2418 open ( FILE
, " $acl_src_banned_mac " );
2419 delete $proxysettings { 'SRC_BANNED_MAC' };
2420 while (< FILE
>) { $proxysettings { 'SRC_BANNED_MAC' } .= $_ };
2423 if (- e
" $acl_src_unrestricted_ip " ) {
2424 open ( FILE
, " $acl_src_unrestricted_ip " );
2425 delete $proxysettings { 'SRC_UNRESTRICTED_IP' };
2426 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ };
2429 if (- e
" $acl_src_unrestricted_mac " ) {
2430 open ( FILE
, " $acl_src_unrestricted_mac " );
2431 delete $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2432 while (< FILE
>) { $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ };
2435 if (- e
" $acl_dst_nocache " ) {
2436 open ( FILE
, " $acl_dst_nocache " );
2437 delete $proxysettings { 'DST_NOCACHE' };
2438 while (< FILE
>) { $proxysettings { 'DST_NOCACHE' } .= $_ };
2441 if (- e
" $acl_dst_noauth " ) {
2442 open ( FILE
, " $acl_dst_noauth " );
2443 delete $proxysettings { 'DST_NOAUTH' };
2444 while (< FILE
>) { $proxysettings { 'DST_NOAUTH' } .= $_ };
2447 if (- e
" $acl_ports_safe " ) {
2448 open ( FILE
, " $acl_ports_safe " );
2449 delete $proxysettings { 'PORTS_SAFE' };
2450 while (< FILE
>) { $proxysettings { 'PORTS_SAFE' } .= $_ };
2453 if (- e
" $acl_ports_ssl " ) {
2454 open ( FILE
, " $acl_ports_ssl " );
2455 delete $proxysettings { 'PORTS_SSL' };
2456 while (< FILE
>) { $proxysettings { 'PORTS_SSL' } .= $_ };
2459 if (- e
" $mimetypes " ) {
2460 open ( FILE
, " $mimetypes " );
2461 delete $proxysettings { 'MIME_TYPES' };
2462 while (< FILE
>) { $proxysettings { 'MIME_TYPES' } .= $_ };
2465 if (- e
" $ntlmdir /msntauth.allowusers" ) {
2466 open ( FILE
, " $ntlmdir /msntauth.allowusers" );
2467 delete $proxysettings { 'NTLM_ALLOW_USERS' };
2468 while (< FILE
>) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ };
2471 if (- e
" $ntlmdir /msntauth.denyusers" ) {
2472 open ( FILE
, " $ntlmdir /msntauth.denyusers" );
2473 delete $proxysettings { 'NTLM_DENY_USERS' };
2474 while (< FILE
>) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ };
2477 if (- e
" $raddir /radauth.allowusers" ) {
2478 open ( FILE
, " $raddir /radauth.allowusers" );
2479 delete $proxysettings { 'RADIUS_ALLOW_USERS' };
2480 while (< FILE
>) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ };
2483 if (- e
" $raddir /radauth.denyusers" ) {
2484 open ( FILE
, " $raddir /radauth.denyusers" );
2485 delete $proxysettings { 'RADIUS_DENY_USERS' };
2486 while (< FILE
>) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ };
2489 if (- e
" $identdir /identauth.allowusers" ) {
2490 open ( FILE
, " $identdir /identauth.allowusers" );
2491 delete $proxysettings { 'IDENT_ALLOW_USERS' };
2492 while (< FILE
>) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ };
2495 if (- e
" $identdir /identauth.denyusers" ) {
2496 open ( FILE
, " $identdir /identauth.denyusers" );
2497 delete $proxysettings { 'IDENT_DENY_USERS' };
2498 while (< FILE
>) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ };
2501 if (- e
" $identhosts " ) {
2502 open ( FILE
, " $identhosts " );
2503 delete $proxysettings { 'IDENT_HOSTS' };
2504 while (< FILE
>) { $proxysettings { 'IDENT_HOSTS' } .= $_ };
2507 if (- e
" $cre_groups " ) {
2508 open ( FILE
, " $cre_groups " );
2509 delete $proxysettings { 'CRE_GROUPS' };
2510 while (< FILE
>) { $proxysettings { 'CRE_GROUPS' } .= $_ };
2513 if (- e
" $cre_svhosts " ) {
2514 open ( FILE
, " $cre_svhosts " );
2515 delete $proxysettings { 'CRE_SVHOSTS' };
2516 while (< FILE
>) { $proxysettings { 'CRE_SVHOSTS' } .= $_ };
2521 # -------------------------------------------------------------------
2525 @temp = split ( /\n/ , $proxysettings { 'PORTS_SAFE' });
2526 undef $proxysettings { 'PORTS_SAFE' };
2529 s/^\s+//g ; s/\s+$//g ;
2533 if ( /^[^#]+\s+#\sSquids\sport/ ) { s/(^[^#]+)(\s+#\sSquids\sport)/$proxysettings{'PROXY_PORT'}\2/ ; $line = $_ ; }
2535 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2536 @templist = split ( /-/ );
2537 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2538 $proxysettings { 'PORTS_SAFE' } .= $line . " \n " ;
2542 @temp = split ( /\n/ , $proxysettings { 'PORTS_SSL' });
2543 undef $proxysettings { 'PORTS_SSL' };
2546 s/^\s+//g ; s/\s+$//g ;
2551 if ( /.*-.*-.*/ ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; }
2552 @templist = split ( /-/ );
2553 foreach ( @templist ) { unless (& General
:: validport
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid destination port' }; } }
2554 $proxysettings { 'PORTS_SSL' } .= $line . " \n " ;
2558 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2559 undef $proxysettings { 'DST_NOCACHE' };
2563 unless ( /^#/ ) { s/\s+//g ; }
2566 if ( /^\./ ) { $_ = '*' . $_ ; }
2567 $proxysettings { 'DST_NOCACHE' } .= $_ . " \n " ;
2571 @temp = split ( /\n/ , $proxysettings { 'SRC_SUBNETS' });
2572 undef $proxysettings { 'SRC_SUBNETS' };
2575 s/^\s+//g ; s/\s+$//g ;
2578 unless (& General
:: validipandmask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2579 $proxysettings { 'SRC_SUBNETS' } .= $_ . " \n " ;
2583 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_IP' });
2584 undef $proxysettings { 'SRC_BANNED_IP' };
2587 s/^\s+//g ; s/\s+$//g ;
2590 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2591 $proxysettings { 'SRC_BANNED_IP' } .= $_ . " \n " ;
2595 @temp = split ( /\n/ , $proxysettings { 'SRC_BANNED_MAC' });
2596 undef $proxysettings { 'SRC_BANNED_MAC' };
2599 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2602 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2603 $proxysettings { 'SRC_BANNED_MAC' } .= $_ . " \n " ;
2607 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_IP' });
2608 undef $proxysettings { 'SRC_UNRESTRICTED_IP' };
2611 s/^\s+//g ; s/\s+$//g ;
2614 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2615 $proxysettings { 'SRC_UNRESTRICTED_IP' } .= $_ . " \n " ;
2619 @temp = split ( /\n/ , $proxysettings { 'SRC_UNRESTRICTED_MAC' });
2620 undef $proxysettings { 'SRC_UNRESTRICTED_MAC' };
2623 s/^\s+//g ; s/\s+$//g ; s/-/:/g ;
2626 unless (& General
:: validmac
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid mac' }; }
2627 $proxysettings { 'SRC_UNRESTRICTED_MAC' } .= $_ . " \n " ;
2631 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2632 undef $proxysettings { 'DST_NOAUTH' };
2636 unless ( /^#/ ) { s/\s+//g ; }
2639 if ( /^\./ ) { $_ = '*' . $_ ; }
2640 $proxysettings { 'DST_NOAUTH' } .= $_ . " \n " ;
2644 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
2646 @temp = split ( /\n/ , $proxysettings { 'NTLM_ALLOW_USERS' });
2647 undef $proxysettings { 'NTLM_ALLOW_USERS' };
2650 s/^\s+//g ; s/\s+$//g ;
2651 if ( $_ ) { $proxysettings { 'NTLM_ALLOW_USERS' } .= $_ . " \n " ; }
2653 if ( $proxysettings { 'NTLM_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2656 if (( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
2658 @temp = split ( /\n/ , $proxysettings { 'NTLM_DENY_USERS' });
2659 undef $proxysettings { 'NTLM_DENY_USERS' };
2662 s/^\s+//g ; s/\s+$//g ;
2663 if ( $_ ) { $proxysettings { 'NTLM_DENY_USERS' } .= $_ . " \n " ; }
2665 if ( $proxysettings { 'NTLM_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2668 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
2670 @temp = split ( /\n/ , $proxysettings { 'IDENT_ALLOW_USERS' });
2671 undef $proxysettings { 'IDENT_ALLOW_USERS' };
2674 s/^\s+//g ; s/\s+$//g ;
2675 if ( $_ ) { $proxysettings { 'IDENT_ALLOW_USERS' } .= $_ . " \n " ; }
2677 if ( $proxysettings { 'IDENT_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2680 if (( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
2682 @temp = split ( /\n/ , $proxysettings { 'IDENT_DENY_USERS' });
2683 undef $proxysettings { 'IDENT_DENY_USERS' };
2686 s/^\s+//g ; s/\s+$//g ;
2687 if ( $_ ) { $proxysettings { 'IDENT_DENY_USERS' } .= $_ . " \n " ; }
2689 if ( $proxysettings { 'IDENT_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2692 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
2694 @temp = split ( /\n/ , $proxysettings { 'RADIUS_ALLOW_USERS' });
2695 undef $proxysettings { 'RADIUS_ALLOW_USERS' };
2698 s/^\s+//g ; s/\s+$//g ;
2699 if ( $_ ) { $proxysettings { 'RADIUS_ALLOW_USERS' } .= $_ . " \n " ; }
2701 if ( $proxysettings { 'RADIUS_ALLOW_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2704 if (( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
2706 @temp = split ( /\n/ , $proxysettings { 'RADIUS_DENY_USERS' });
2707 undef $proxysettings { 'RADIUS_DENY_USERS' };
2710 s/^\s+//g ; s/\s+$//g ;
2711 if ( $_ ) { $proxysettings { 'RADIUS_DENY_USERS' } .= $_ . " \n " ; }
2713 if ( $proxysettings { 'RADIUS_DENY_USERS' } eq '' ) { $errormessage = $Lang :: tr
{ 'advproxy errmsg acl cannot be empty' }; }
2716 @temp = split ( /\n/ , $proxysettings { 'IDENT_HOSTS' });
2717 undef $proxysettings { 'IDENT_HOSTS' };
2720 s/^\s+//g ; s/\s+$//g ;
2723 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2724 $proxysettings { 'IDENT_HOSTS' } .= $_ . " \n " ;
2728 @temp = split ( /\n/ , $proxysettings { 'CRE_SVHOSTS' });
2729 undef $proxysettings { 'CRE_SVHOSTS' };
2732 s/^\s+//g ; s/\s+$//g ;
2735 unless (& General
:: validipormask
( $_ )) { $errormessage = $Lang :: tr
{ 'advproxy errmsg invalid ip or mask' }; }
2736 $proxysettings { 'CRE_SVHOSTS' } .= $_ . " \n " ;
2741 # -------------------------------------------------------------------
2745 open ( FILE
, "> $acl_src_subnets " );
2747 if (! $proxysettings { 'SRC_SUBNETS' })
2749 print FILE
" $green_cidr \n " ;
2750 if ( $netsettings { 'BLUE_DEV' })
2752 print FILE
" $blue_cidr \n " ;
2754 } else { print FILE
$proxysettings { 'SRC_SUBNETS' }; }
2757 open ( FILE
, "> $acl_src_banned_ip " );
2759 print FILE
$proxysettings { 'SRC_BANNED_IP' };
2762 open ( FILE
, "> $acl_src_banned_mac " );
2764 print FILE
$proxysettings { 'SRC_BANNED_MAC' };
2767 open ( FILE
, "> $acl_src_unrestricted_ip " );
2769 print FILE
$proxysettings { 'SRC_UNRESTRICTED_IP' };
2772 open ( FILE
, "> $acl_src_unrestricted_mac " );
2774 print FILE
$proxysettings { 'SRC_UNRESTRICTED_MAC' };
2777 open ( FILE
, "> $acl_dst_noauth " );
2779 print FILE
$proxysettings { 'DST_NOAUTH' };
2782 open ( FILE
, "> $acl_dst_noauth_net " );
2784 open ( FILE
, "> $acl_dst_noauth_dom " );
2786 open ( FILE
, "> $acl_dst_noauth_url " );
2789 @temp = split ( /\n/ , $proxysettings { 'DST_NOAUTH' });
2797 open ( FILE
, ">> $acl_dst_noauth_dom " );
2802 elsif (& General
:: validipormask
( $_ ))
2804 open ( FILE
, ">> $acl_dst_noauth_net " );
2809 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?/ )
2811 open ( FILE
, ">> $acl_dst_noauth_net " );
2818 open ( FILE
, ">> $acl_dst_noauth_url " );
2820 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2826 open ( FILE
, "> $acl_dst_nocache " );
2828 print FILE
$proxysettings { 'DST_NOCACHE' };
2831 open ( FILE
, "> $acl_dst_nocache_net " );
2833 open ( FILE
, "> $acl_dst_nocache_dom " );
2835 open ( FILE
, "> $acl_dst_nocache_url " );
2838 @temp = split ( /\n/ , $proxysettings { 'DST_NOCACHE' });
2846 open ( FILE
, ">> $acl_dst_nocache_dom " );
2851 elsif (& General
:: validipormask
( $_ ))
2853 open ( FILE
, ">> $acl_dst_nocache_net " );
2858 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?/ )
2860 open ( FILE
, ">> $acl_dst_nocache_net " );
2867 open ( FILE
, ">> $acl_dst_nocache_url " );
2869 if ( /^[fh]tt?ps?:\/ \
// ) { print FILE
" $_ \n " ; } else { print FILE
"^[fh]tt?ps?:// $_ \n " ; }
2875 open ( FILE
, "> $acl_ports_safe " );
2877 if (! $proxysettings { 'PORTS_SAFE' }) { print FILE
$def_ports_safe ; } else { print FILE
$proxysettings { 'PORTS_SAFE' }; }
2880 open ( FILE
, "> $acl_ports_ssl " );
2882 if (! $proxysettings { 'PORTS_SSL' }) { print FILE
$def_ports_ssl ; } else { print FILE
$proxysettings { 'PORTS_SSL' }; }
2885 open ( FILE
, "> $acl_dst_throttle " );
2887 if ( $proxysettings { 'THROTTLE_BINARY' } eq 'on' )
2889 @temp = split ( /\|/ , $throttle_binary );
2890 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2892 if ( $proxysettings { 'THROTTLE_DSKIMG' } eq 'on' )
2894 @temp = split ( /\|/ , $throttle_dskimg );
2895 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2897 if ( $proxysettings { 'THROTTLE_MMEDIA' } eq 'on' )
2899 @temp = split ( /\|/ , $throttle_mmedia );
2900 foreach ( @temp ) { print FILE
" \\ . $_ \$ \n " ; }
2902 if (- s
$throttled_urls )
2904 open ( URLFILE
, $throttled_urls );
2907 foreach ( @temp ) { print FILE
; }
2911 open ( FILE
, "> $mimetypes " );
2913 print FILE
$proxysettings { 'MIME_TYPES' };
2916 open ( FILE
, "> $ntlmdir /msntauth.allowusers" );
2918 print FILE
$proxysettings { 'NTLM_ALLOW_USERS' };
2921 open ( FILE
, "> $ntlmdir /msntauth.denyusers" );
2923 print FILE
$proxysettings { 'NTLM_DENY_USERS' };
2926 open ( FILE
, "> $raddir /radauth.allowusers" );
2928 print FILE
$proxysettings { 'RADIUS_ALLOW_USERS' };
2931 open ( FILE
, "> $raddir /radauth.denyusers" );
2933 print FILE
$proxysettings { 'RADIUS_DENY_USERS' };
2936 open ( FILE
, "> $identdir /identauth.allowusers" );
2938 print FILE
$proxysettings { 'IDENT_ALLOW_USERS' };
2941 open ( FILE
, "> $identdir /identauth.denyusers" );
2943 print FILE
$proxysettings { 'IDENT_DENY_USERS' };
2946 open ( FILE
, "> $identhosts " );
2948 print FILE
$proxysettings { 'IDENT_HOSTS' };
2951 open ( FILE
, "> $cre_groups " );
2953 print FILE
$proxysettings { 'CRE_GROUPS' };
2956 open ( FILE
, "> $cre_svhosts " );
2958 print FILE
$proxysettings { 'CRE_SVHOSTS' };
2962 # -------------------------------------------------------------------
2966 open ( FILE
, ">/srv/web/ipfire/html/proxy.pac" );
2968 print FILE
"function FindProxyForURL(url, host) \n " ;
2970 if (( $proxysettings { 'ENABLE' } eq 'on' ) || ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
2974 (isPlainHostName(host)) ||
2975 (dnsDomainIs(host, ". $mainsettings {'DOMAINNAME'}")) ||
2976 (isInNet(host, "127.0.0.1", "255.0.0.0")) ||
2977 (isInNet(host, "10.0.0.0", "255.0.0.0")) ||
2978 (isInNet(host, "172.16.0.0", "255.240.0.0")) ||
2979 (isInNet(host, "192.168.0.0", "255.255.0.0")) ||
2980 (isInNet(host, "169.254.0.0", "255.255.0.0"))
2988 if ( $proxysettings { 'ENABLE' } eq 'on' )
2990 print FILE
"if ( \n " ;
2991 print FILE
" (isInNet(myIpAddress(), \" $netsettings {'GREEN_NETADDRESS'} \" , \" $netsettings {'GREEN_NETMASK'} \" ))" ;
2994 if (- e
" $acl_src_subnets " ) {
2995 open ( SUBNETS
, " $acl_src_subnets " );
2996 @templist = < SUBNETS
>;
3002 @temp = split ( /\/ /);
3004 ( $temp [ 0 ] ne $netsettings { 'GREEN_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'GREEN_NETMASK' }) &&
3005 ( $temp [ 0 ] ne $netsettings { 'BLUE_NETADDRESS' }) && ( $temp [ 1 ] ne $netsettings { 'BLUE_NETMASK' })
3009 print FILE
" || \n (isInNet(myIpAddress(), \" $temp [0] \" , \" $temp [1] \" ))" ;
3019 return "PROXY $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
3023 if (( $proxysettings { 'ENABLE' } eq 'on' ) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ) && ( $netsettings { 'BLUE_DEV' }))
3025 print FILE
" \n else \n\n " ;
3027 if (( $netsettings { 'BLUE_DEV' }) && ( $proxysettings { 'ENABLE_BLUE' } eq 'on' ))
3031 (isInNet(myIpAddress(), " $netsettings {'BLUE_NETADDRESS'}", " $netsettings {'BLUE_NETMASK'}"))
3033 return "PROXY $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}";
3042 # -------------------------------------------------------------------
3049 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } +
3050 $proxysettings { 'THROTTLING_GREEN_HOST' } +
3051 $proxysettings { 'THROTTLING_BLUE_TOTAL' } +
3052 $proxysettings { 'THROTTLING_BLUE_HOST' } gt 0 )
3054 $delaypools = 1 ; } else { $delaypools = 0 ;
3057 if ( $proxysettings { 'AUTH_REALM' } eq '' )
3059 $authrealm = "IPFire Advanced Proxy Server" ;
3061 $authrealm = $proxysettings { 'AUTH_REALM' };
3064 $_ = $proxysettings { 'UPSTREAM_PROXY' };
3065 my ( $remotehost , $remoteport ) = split ( /:/ , $_ );
3067 if ( $remoteport eq '' ) { $remoteport = 80 ; }
3069 open ( FILE
, ">${General::swroot}/proxy/squid.conf" );
3072 # Do not modify '${General::swroot}/proxy/squid.conf' directly since any changes
3073 # you make will be overwritten whenever you resave proxy settings using the
3076 # Instead, modify the file ' $acl_include ' and
3077 # then restart the proxy service using the web interface. Changes made to the
3078 # 'include.acl' file will propagate to the 'squid.conf' file at that time.
3080 shutdown_lifetime 5 seconds
3086 # Include file with user defined settings.
3087 if (- e
"/etc/squid/squid.conf.pre.local" ) {
3088 print FILE
"include /etc/squid/squid.conf.pre.local \n\n " ;
3091 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
3092 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3095 if ( $proxysettings { 'TRANSPARENT' } eq 'on' ) {
3096 print FILE
"http_port $netsettings {'GREEN_ADDRESS'}: $proxysettings {'TRANSPARENT_PORT'} intercept" ;
3097 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3101 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3102 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'PROXY_PORT'}" ;
3103 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3106 if ( $proxysettings { 'TRANSPARENT_BLUE' } eq 'on' ) {
3107 print FILE
"http_port $netsettings {'BLUE_ADDRESS'}: $proxysettings {'TRANSPARENT_PORT'} intercept" ;
3108 if ( $proxysettings { 'NO_CONNECTION_AUTH' } eq 'on' ) { print FILE
" no-connection-auth" }
3113 if ( $proxysettings { 'CACHE_SIZE' } > 0 )
3117 if (!- z
$acl_dst_nocache_dom ) {
3118 print FILE
"acl no_cache_domains dstdomain \" $acl_dst_nocache_dom \"\n " ;
3119 print FILE
"cache deny no_cache_domains \n " ;
3121 if (!- z
$acl_dst_nocache_net ) {
3122 print FILE
"acl no_cache_ipaddr dst \" $acl_dst_nocache_net \"\n " ;
3123 print FILE
"cache deny no_cache_ipaddr \n " ;
3125 if (!- z
$acl_dst_nocache_url ) {
3126 print FILE
"acl no_cache_hosts url_regex -i \" $acl_dst_nocache_url \"\n " ;
3127 print FILE
"cache deny no_cache_hosts \n " ;
3133 cache_effective_user squid
3134 cache_effective_group squid
3137 pid_filename /var/run/squid.pid
3139 cache_mem $proxysettings {'CACHE_MEM'} MB
3142 print FILE
"error_directory $errordir / $proxysettings {'ERR_LANGUAGE'} \n\n " ;
3144 if ( $proxysettings { 'OFFLINE_MODE' } eq 'on' ) { print FILE
"offline_mode on \n\n " ; }
3145 if ( $proxysettings { 'CACHE_DIGESTS' } eq 'on' ) { print FILE
"digest_generation on \n\n " ; } else { print FILE
"digest_generation off \n\n " ; }
3147 if ((!( $proxysettings { 'MEM_POLICY' } eq 'LRU' )) || (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' )))
3149 if (!( $proxysettings { 'MEM_POLICY' } eq 'LRU' ))
3151 print FILE
"memory_replacement_policy $proxysettings {'MEM_POLICY'} \n " ;
3153 if (!( $proxysettings { 'CACHE_POLICY' } eq 'LRU' ))
3155 print FILE
"cache_replacement_policy $proxysettings {'CACHE_POLICY'} \n " ;
3160 if ( $proxysettings { 'CACHE_SIZE' } ne '0' )
3162 print FILE
"cache_dir aufs /var/log/cache $proxysettings {'CACHE_SIZE'} $proxysettings {'L1_DIRS'} 256 \n\n " ;
3165 if ( $proxysettings { 'LOGGING' } eq 'on' )
3168 access_log stdio:/var/log/squid/access.log
3169 cache_log /var/log/squid/cache.log
3170 cache_store_log none
3173 if ( $proxysettings { 'LOGUSERAGENT' } eq 'on' ) { print FILE
"access_log stdio:\/var\/log\/squid\/user_agent.log useragent \n " ; }
3174 if ( $proxysettings { 'LOGQUERY' } eq 'on' ) { print FILE
" \n strip_query_terms off \n " ; }
3177 access_log /dev/null
3179 cache_store_log none
3188 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'on' )
3190 print FILE
"forwarded_for on \n " ;
3192 print FILE
"forwarded_for off \n " ;
3194 if ( $proxysettings { 'FORWARD_VIA' } eq 'on' )
3196 print FILE
"via on \n " ;
3198 print FILE
"via off \n " ;
3202 if ((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3204 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3206 print FILE
"auth_param basic program $authdir /basic_ncsa_auth $userdb \n " ;
3207 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3208 print FILE
"auth_param basic realm $authrealm \n " ;
3209 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3210 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3213 if ( $proxysettings { 'AUTH_METHOD' } eq 'ldap' )
3215 print FILE
"auth_param basic utf8 on \n " ;
3216 print FILE
"auth_param basic program $authdir /basic_ldap_auth -b \" $proxysettings {'LDAP_BASEDN'} \" " ;
3217 if (!( $proxysettings { 'LDAP_BINDDN_USER' } eq '' )) { print FILE
" -D \" $proxysettings {'LDAP_BINDDN_USER'} \" " ; }
3218 if (!( $proxysettings { 'LDAP_BINDDN_PASS' } eq '' )) { print FILE
" -w $proxysettings {'LDAP_BINDDN_PASS'}" ; }
3219 if ( $proxysettings { 'LDAP_TYPE' } eq 'ADS' )
3221 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3223 print FILE
" -f \" (\&(objectClass=person)(sAMAccountName=\ %s )) \" " ;
3225 print FILE
" -f \" (\&(\&(objectClass=person)(sAMAccountName=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3227 print FILE
" -u sAMAccountName -P" ;
3229 if ( $proxysettings { 'LDAP_TYPE' } eq 'NDS' )
3231 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3233 print FILE
" -f \" (\&(objectClass=person)(cn=\ %s )) \" " ;
3235 print FILE
" -f \" (\&(\&(objectClass=person)(cn=\ %s ))(groupMembership= $proxysettings {'LDAP_GROUP'})) \" " ;
3237 print FILE
" -u cn -P" ;
3239 if (( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) || ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ))
3241 if ( $proxysettings { 'LDAP_GROUP' } eq '' )
3243 print FILE
" -f \" (\&(objectClass=person)(uid=\ %s )) \" " ;
3245 print FILE
" -f \" (\&(\&(objectClass=person)(uid=\ %s ))(memberOf= $proxysettings {'LDAP_GROUP'})) \" " ;
3247 if ( $proxysettings { 'LDAP_TYPE' } eq 'V2' ) { print FILE
" -v 2" ; }
3248 if ( $proxysettings { 'LDAP_TYPE' } eq 'V3' ) { print FILE
" -v 3" ; }
3249 print FILE
" -u uid -P" ;
3251 print FILE
" $proxysettings {'LDAP_SERVER'}: $proxysettings {'LDAP_PORT'} \n " ;
3252 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3253 print FILE
"auth_param basic realm $authrealm \n " ;
3254 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3255 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3258 if ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' )
3260 if ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' )
3262 print FILE
"auth_param ntlm program $authdir /ntlm_smb_lm_auth $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_PDC'}" ;
3263 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print FILE
" \n " ; } else { print FILE
" $proxysettings {'NTLM_DOMAIN'}/ $proxysettings {'NTLM_BDC'} \n " ; }
3264 print FILE
"auth_param ntlm children $proxysettings {'AUTH_CHILDREN'} \n " ;
3265 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3267 print FILE
"auth_param basic program $authdir /basic_msnt_auth \n " ;
3268 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3269 print FILE
"auth_param basic realm $authrealm \n " ;
3270 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3271 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3273 open ( MSNTCONF
, "> $ntlmdir /msntauth.conf" );
3275 print MSNTCONF
"server $proxysettings {'NTLM_PDC'}" ;
3276 if ( $proxysettings { 'NTLM_BDC' } eq '' ) { print MSNTCONF
" $proxysettings {'NTLM_PDC'}" ; } else { print MSNTCONF
" $proxysettings {'NTLM_BDC'}" ; }
3277 print MSNTCONF
" $proxysettings {'NTLM_DOMAIN'} \n " ;
3278 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3280 if ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' )
3282 print MSNTCONF
"allowusers $ntlmdir /msntauth.allowusers \n " ;
3284 print MSNTCONF
"denyusers $ntlmdir /msntauth.denyusers \n " ;
3291 if ( $proxysettings { 'AUTH_METHOD' } eq 'radius' )
3293 print FILE
"auth_param basic program $authdir /basic_radius_auth -h $proxysettings {'RADIUS_SERVER'} -p $proxysettings {'RADIUS_PORT'} " ;
3294 if (!( $proxysettings { 'RADIUS_IDENTIFIER' } eq '' )) { print FILE
"-i $proxysettings {'RADIUS_IDENTIFIER'} " ; }
3295 print FILE
"-w $proxysettings {'RADIUS_SECRET'} \n " ;
3296 print FILE
"auth_param basic children $proxysettings {'AUTH_CHILDREN'} \n " ;
3297 print FILE
"auth_param basic realm $authrealm \n " ;
3298 print FILE
"auth_param basic credentialsttl $proxysettings {'AUTH_CACHE_TTL'} minutes \n " ;
3299 if (!( $proxysettings { 'AUTH_IPCACHE_TTL' } eq '0' )) { print FILE
" \n authenticate_ip_ttl $proxysettings {'AUTH_IPCACHE_TTL'} minutes \n " ; }
3303 print FILE
"acl for_inetusers proxy_auth REQUIRED \n " ;
3304 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) && ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ))
3306 if ((!- z
" $ntlmdir /msntauth.allowusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ))
3308 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.allowusers \"\n " ;
3310 if ((!- z
" $ntlmdir /msntauth.denyusers" ) && ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ))
3312 print FILE
"acl for_acl_users proxy_auth \" $ntlmdir /msntauth.denyusers \"\n " ;
3315 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3317 if ((!- z
" $raddir /radauth.allowusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ))
3319 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.allowusers \"\n " ;
3321 if ((!- z
" $raddir /radauth.denyusers" ) && ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ))
3323 print FILE
"acl for_acl_users proxy_auth \" $raddir /radauth.denyusers \"\n " ;
3326 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3329 if (!- z
$extgrp ) { print FILE
"acl for_extended_users proxy_auth \" $extgrp \"\n " ; }
3330 if (!- z
$disgrp ) { print FILE
"acl for_disabled_users proxy_auth \" $disgrp \"\n " ; }
3332 if (!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) { print FILE
" \n acl concurrent max_user_ip -s $proxysettings {'AUTH_MAX_USERIP'} \n " ; }
3335 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3336 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3337 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3342 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3344 if ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' )
3346 print FILE
"acl for_inetusers ident REQUIRED \n " ;
3348 if ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' )
3350 if ((!- z
" $identdir /identauth.allowusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ))
3352 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.allowusers \"\n\n " ;
3354 if ((!- z
" $identdir /identauth.denyusers" ) && ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ))
3356 print FILE
"acl for_acl_users ident_regex -i \" $identdir /identauth.denyusers \"\n\n " ;
3359 if (!- z
$acl_dst_noauth_net ) { print FILE
"acl to_ipaddr_without_auth dst \" $acl_dst_noauth_net \"\n " ; }
3360 if (!- z
$acl_dst_noauth_dom ) { print FILE
"acl to_domains_without_auth dstdomain \" $acl_dst_noauth_dom \"\n " ; }
3361 if (!- z
$acl_dst_noauth_url ) { print FILE
"acl to_hosts_without_auth url_regex -i \" $acl_dst_noauth_url \"\n " ; }
3365 if (( $delaypools ) && (!- z
$acl_dst_throttle )) { print FILE
"acl for_throttled_urls url_regex -i \" $acl_dst_throttle \"\n\n " ; }
3367 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
"acl with_allowed_useragents browser $browser_regexp \n\n " ; }
3369 print FILE
"acl within_timeframe time " ;
3370 if ( $proxysettings { 'TIME_MON' } eq 'on' ) { print FILE
"M" ; }
3371 if ( $proxysettings { 'TIME_TUE' } eq 'on' ) { print FILE
"T" ; }
3372 if ( $proxysettings { 'TIME_WED' } eq 'on' ) { print FILE
"W" ; }
3373 if ( $proxysettings { 'TIME_THU' } eq 'on' ) { print FILE
"H" ; }
3374 if ( $proxysettings { 'TIME_FRI' } eq 'on' ) { print FILE
"F" ; }
3375 if ( $proxysettings { 'TIME_SAT' } eq 'on' ) { print FILE
"A" ; }
3376 if ( $proxysettings { 'TIME_SUN' } eq 'on' ) { print FILE
"S" ; }
3377 print FILE
" $proxysettings {'TIME_FROM_HOUR'}:" ;
3378 print FILE
" $proxysettings {'TIME_FROM_MINUTE'}-" ;
3379 print FILE
" $proxysettings {'TIME_TO_HOUR'}:" ;
3380 print FILE
" $proxysettings {'TIME_TO_MINUTE'} \n\n " ;
3382 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3383 print FILE
"acl blocked_mimetypes rep_mime_type \" $mimetypes \"\n\n " ;
3386 open ( PORTS
, " $acl_ports_ssl " );
3391 foreach ( @temp ) { print FILE
"acl SSL_ports port $_ " ; }
3393 open ( PORTS
, " $acl_ports_safe " );
3398 foreach ( @temp ) { print FILE
"acl Safe_ports port $_ " ; }
3402 acl IPFire_http port $http_port
3403 acl IPFire_https port $https_port
3404 acl IPFire_ips dst $netsettings {'GREEN_ADDRESS'}
3405 acl IPFire_networks src " $acl_src_subnets "
3406 acl IPFire_servers dst " $acl_src_subnets "
3407 acl IPFire_green_network src $green_cidr
3408 acl IPFire_green_servers dst $green_cidr
3411 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_network src $blue_cidr \n " ; }
3412 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"acl IPFire_blue_servers dst $blue_cidr \n " ; }
3413 if (!- z
$acl_src_banned_ip ) { print FILE
"acl IPFire_banned_ips src \" $acl_src_banned_ip \"\n " ; }
3414 if (!- z
$acl_src_banned_mac ) { print FILE
"acl IPFire_banned_mac arp \" $acl_src_banned_mac \"\n " ; }
3415 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"acl IPFire_unrestricted_ips src \" $acl_src_unrestricted_ip \"\n " ; }
3416 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"acl IPFire_unrestricted_mac arp \" $acl_src_unrestricted_mac \"\n " ; }
3418 acl CONNECT method CONNECT
3422 if ( $proxysettings { 'CLASSROOM_EXT' } eq 'on' ) {
3425 #Classroom extensions
3426 acl IPFire_no_access_ips src " $acl_src_noaccess_ip "
3427 acl IPFire_no_access_mac arp " $acl_src_noaccess_mac "
3430 print FILE
"deny_info " ;
3431 if (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ))
3433 print FILE
"ERR_ACCESS_DISABLED" ;
3435 print FILE
"ERR_ACCESS_DENIED" ;
3437 print FILE
" IPFire_no_access_ips \n " ;
3438 print FILE
"deny_info " ;
3439 if (( $proxysettings { 'ERR_DESIGN' } eq 'squid' ) && (- e
" $errordir / $proxysettings {'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED" ))
3441 print FILE
"ERR_ACCESS_DISABLED" ;
3443 print FILE
"ERR_ACCESS_DENIED" ;
3445 print FILE
" IPFire_no_access_mac \n " ;
3448 http_access deny IPFire_no_access_ips
3449 http_access deny IPFire_no_access_mac
3454 #Insert acl file and replace __VAR__ with correct values
3455 my $blue_net = '' ; #BLUE empty by default
3457 if ( $netsettings { 'BLUE_DEV' } && $proxysettings { 'ENABLE_BLUE' } eq 'on' ) {
3458 $blue_net = " $blue_cidr " ;
3459 $blue_ip = " $netsettings {'BLUE_ADDRESS'}" ;
3461 if (!- z
$acl_include )
3463 open ( ACL
, " $acl_include " );
3464 print FILE
" \n #Start of custom includes \n\n " ;
3466 $_ =~ s/__GREEN_IP__/$netsettings{'GREEN_ADDRESS'}/ ;
3467 $_ =~ s/__GREEN_NET__/$green_cidr/ ;
3468 $_ =~ s/__BLUE_IP__/$blue_ip/ ;
3469 $_ =~ s/__BLUE_NET__/$blue_net/ ;
3470 $_ =~ s/__PROXY_PORT__/$proxysettings{'PROXY_PORT'}/ ;
3473 print FILE
" \n #End of custom includes \n " ;
3476 if ((!- z
$extgrp ) && ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && ( $proxysettings { 'NCSA_BYPASS_REDIR' } eq 'on' )) { print FILE
" \n redirector_access deny for_extended_users \n " ; }
3478 # Check if squidclamav is enabled.
3479 if ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ) {
3480 print FILE
" \n #Settings for squidclamav: \n " ;
3481 print FILE
"http_port 127.0.0.1: $proxysettings {'PROXY_PORT'} \n " ;
3482 print FILE
"acl purge method PURGE \n " ;
3483 print FILE
"http_access deny to_localhost \n " ;
3484 print FILE
"http_access allow localhost \n " ;
3485 print FILE
"http_access allow purge localhost \n " ;
3486 print FILE
"http_access deny purge \n " ;
3487 print FILE
"url_rewrite_access deny localhost \n " ;
3492 #local machine, no restriction
3493 http_access allow localhost
3495 #GUI admin if local machine connects
3496 http_access allow IPFire_ips IPFire_networks IPFire_http
3497 http_access allow CONNECT IPFire_ips IPFire_networks IPFire_https
3499 #Deny not web services
3500 http_access deny !Safe_ports
3501 http_access deny CONNECT !SSL_ports
3506 if ( $proxysettings { 'AUTH_METHOD' } eq 'ident' )
3508 print FILE
"#Set ident ACLs \n " ;
3509 if (!- z
$identhosts )
3511 print FILE
"acl on_ident_aware_hosts src \" $identhosts \"\n " ;
3512 print FILE
"ident_lookup_access allow on_ident_aware_hosts \n " ;
3513 print FILE
"ident_lookup_access deny all \n " ;
3515 print FILE
"ident_lookup_access allow all \n " ;
3517 print FILE
"ident_timeout $proxysettings {'IDENT_TIMEOUT'} seconds \n\n " ;
3521 print FILE
"#Set download throttling \n " ;
3523 if ( $netsettings { 'BLUE_DEV' })
3525 print FILE
"delay_pools 2 \n " ;
3527 print FILE
"delay_pools 1 \n " ;
3530 print FILE
"delay_class 1 3 \n " ;
3531 if ( $netsettings { 'BLUE_DEV' }) { print FILE
"delay_class 2 3 \n " ; }
3533 print FILE
"delay_parameters 1 " ;
3534 if ( $proxysettings { 'THROTTLING_GREEN_TOTAL' } eq 'unlimited' )
3538 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 125 ;
3540 print FILE
$proxysettings { 'THROTTLING_GREEN_TOTAL' } * 250 ;
3543 print FILE
" -1/-1 " ;
3544 if ( $proxysettings { 'THROTTLING_GREEN_HOST' } eq 'unlimited' )
3548 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 125 ;
3550 print FILE
$proxysettings { 'THROTTLING_GREEN_HOST' } * 250 ;
3554 if ( $netsettings { 'BLUE_DEV' })
3556 print FILE
"delay_parameters 2 " ;
3557 if ( $proxysettings { 'THROTTLING_BLUE_TOTAL' } eq 'unlimited' )
3561 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 125 ;
3563 print FILE
$proxysettings { 'THROTTLING_BLUE_TOTAL' } * 250 ;
3565 print FILE
" -1/-1 " ;
3566 if ( $proxysettings { 'THROTTLING_BLUE_HOST' } eq 'unlimited' )
3570 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 125 ;
3572 print FILE
$proxysettings { 'THROTTLING_BLUE_HOST' } * 250 ;
3577 print FILE
"delay_access 1 deny IPFire_ips \n " ;
3578 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 1 deny IPFire_unrestricted_ips \n " ; }
3579 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 1 deny IPFire_unrestricted_mac \n " ; }
3580 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 1 deny for_extended_users \n " ; }
3582 if ( $netsettings { 'BLUE_DEV' })
3584 print FILE
"delay_access 1 allow IPFire_green_network" ;
3585 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3587 print FILE
"delay_access 1 deny all \n " ;
3589 print FILE
"delay_access 1 allow all" ;
3590 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3594 if ( $netsettings { 'BLUE_DEV' })
3596 print FILE
"delay_access 2 deny IPFire_ips \n " ;
3597 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"delay_access 2 deny IPFire_unrestricted_ips \n " ; }
3598 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"delay_access 2 deny IPFire_unrestricted_mac \n " ; }
3599 if (( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' ) && (!- z
$extgrp )) { print FILE
"delay_access 2 deny for_extended_users \n " ; }
3600 print FILE
"delay_access 2 allow IPFire_blue_network" ;
3601 if (!- z
$acl_dst_throttle ) { print FILE
" for_throttled_urls" ; }
3603 print FILE
"delay_access 2 deny all \n " ;
3606 print FILE
"delay_initial_bucket_level 100 \n " ;
3610 if ( $proxysettings { 'NO_PROXY_LOCAL' } eq 'on' )
3612 print FILE
"#Prevent internal proxy access to Green except IPFire itself \n " ;
3613 print FILE
"http_access deny IPFire_green_servers !IPFire_ips !IPFire_green_network \n\n " ;
3616 if ( $proxysettings { 'NO_PROXY_LOCAL_BLUE' } eq 'on' )
3618 print FILE
"#Prevent internal proxy access from Blue except IPFire itself \n " ;
3619 print FILE
"http_access allow IPFire_blue_network IPFire_blue_servers \n " ;
3620 print FILE
"http_access deny IPFire_blue_network !IPFire_ips IPFire_servers \n\n " ;
3624 #Set custom configured ACLs
3627 if (!- z
$acl_src_banned_ip ) { print FILE
"http_access deny IPFire_banned_ips \n " ; }
3628 if (!- z
$acl_src_banned_mac ) { print FILE
"http_access deny IPFire_banned_mac \n " ; }
3630 if ((!- z
$acl_dst_noauth ) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )))
3632 if (!- z
$acl_src_unrestricted_ip )
3634 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_ips to_ipaddr_without_auth \n " ; }
3635 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_ips to_domains_without_auth \n " ; }
3636 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_ips to_hosts_without_auth \n " ; }
3638 if (!- z
$acl_src_unrestricted_mac )
3640 if (!- z
$acl_dst_noauth_net ) { print FILE
"http_access allow IPFire_unrestricted_mac to_ipaddr_without_auth \n " ; }
3641 if (!- z
$acl_dst_noauth_dom ) { print FILE
"http_access allow IPFire_unrestricted_mac to_domains_without_auth \n " ; }
3642 if (!- z
$acl_dst_noauth_url ) { print FILE
"http_access allow IPFire_unrestricted_mac to_hosts_without_auth \n " ; }
3644 if (!- z
$acl_dst_noauth_net )
3646 print FILE
"http_access allow IPFire_networks" ;
3647 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3648 print FILE
" !within_timeframe" ;
3650 print FILE
" within_timeframe" ; }
3651 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3652 print FILE
" to_ipaddr_without_auth \n " ;
3654 if (!- z
$acl_dst_noauth_dom )
3656 print FILE
"http_access allow IPFire_networks" ;
3657 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3658 print FILE
" !within_timeframe" ;
3660 print FILE
" within_timeframe" ; }
3661 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3662 print FILE
" to_domains_without_auth \n " ;
3664 if (!- z
$acl_dst_noauth_url )
3666 print FILE
"http_access allow IPFire_networks" ;
3667 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3668 print FILE
" !within_timeframe" ;
3670 print FILE
" within_timeframe" ; }
3671 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3672 print FILE
" to_hosts_without_auth \n " ;
3676 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ))
3678 print FILE
"http_access deny !for_inetusers" ;
3679 if (!- z
$identhosts ) { print FILE
" on_ident_aware_hosts" ; }
3684 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3685 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' ) &&
3686 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3687 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3688 (!- z
" $identdir /identauth.denyusers" )
3691 print FILE
"http_access deny for_acl_users" ;
3692 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3696 if (!- z
$acl_src_unrestricted_ip )
3698 print FILE
"http_access allow IPFire_unrestricted_ips" ;
3699 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3701 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3703 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3705 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3707 print FILE
" for_inetusers" ;
3709 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3711 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3713 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3715 print FILE
" for_acl_users" ;
3717 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3719 print FILE
" !for_acl_users" ;
3721 } else { print FILE
" for_inetusers" ; }
3723 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3725 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3727 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3729 print FILE
" for_acl_users" ;
3731 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3733 print FILE
" !for_acl_users" ;
3735 } else { print FILE
" for_inetusers" ; }
3741 if (!- z
$acl_src_unrestricted_mac )
3743 print FILE
"http_access allow IPFire_unrestricted_mac" ;
3744 if ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'on' )
3746 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3748 if (!- z
$disgrp ) { print FILE
" !for_disabled_users" ; } else { print FILE
" for_inetusers" ; }
3750 if (( $proxysettings { 'AUTH_METHOD' } eq 'ldap' ) || (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'off' )) || ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ))
3752 print FILE
" for_inetusers" ;
3754 if (( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) && ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ))
3756 if ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' )
3758 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) && (!- z
" $ntlmdir /msntauth.allowusers" ))
3760 print FILE
" for_acl_users" ;
3762 if (( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) && (!- z
" $ntlmdir /msntauth.denyusers" ))
3764 print FILE
" !for_acl_users" ;
3766 } else { print FILE
" for_inetusers" ; }
3768 if (( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) && ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ))
3770 if ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' )
3772 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) && (!- z
" $raddir /radauth.allowusers" ))
3774 print FILE
" for_acl_users" ;
3776 if (( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) && (!- z
" $raddir /radauth.denyusers" ))
3778 print FILE
" !for_acl_users" ;
3780 } else { print FILE
" for_inetusers" ; }
3786 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3788 if (!- z
$disgrp ) { print FILE
"http_access deny for_disabled_users \n " ; }
3789 if (!- z
$extgrp ) { print FILE
"http_access allow IPFire_networks for_extended_users \n " ; }
3794 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3795 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3796 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3797 ( $proxysettings { 'NTLM_USER_ACL' } eq 'negative' ) &&
3798 (!- z
" $ntlmdir /msntauth.denyusers" )
3802 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3803 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3804 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'negative' ) &&
3805 (!- z
" $raddir /radauth.denyusers" )
3809 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3810 ( $proxysettings { 'AUTH_ALWAYS_REQUIRED' } eq 'off' ) &&
3811 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3812 ( $proxysettings { 'IDENT_USER_ACL' } eq 'negative' ) &&
3813 (!- z
" $identdir /identauth.denyusers" )
3817 print FILE
"http_access deny for_acl_users" ;
3818 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && (!- z
" $identdir /hosts" )) { print FILE
" on_ident_aware_hosts" ; }
3822 if (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) && (!- z
" $identhosts " ))
3824 print FILE
"http_access allow" ;
3825 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3826 print FILE
" !within_timeframe" ;
3828 print FILE
" within_timeframe" ; }
3829 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3830 print FILE
" !on_ident_aware_hosts \n " ;
3833 print FILE
"http_access allow IPFire_networks" ;
3836 ( $proxysettings { 'AUTH_METHOD' } eq 'ntlm' ) &&
3837 ( $proxysettings { 'NTLM_ENABLE_INT_AUTH' } eq 'on' ) &&
3838 ( $proxysettings { 'NTLM_ENABLE_ACL' } eq 'on' ) &&
3839 ( $proxysettings { 'NTLM_USER_ACL' } eq 'positive' ) &&
3840 (!- z
" $ntlmdir /msntauth.allowusers" )
3844 ( $proxysettings { 'AUTH_METHOD' } eq 'radius' ) &&
3845 ( $proxysettings { 'RADIUS_ENABLE_ACL' } eq 'on' ) &&
3846 ( $proxysettings { 'RADIUS_USER_ACL' } eq 'positive' ) &&
3847 (!- z
" $raddir /radauth.allowusers" )
3851 ( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) &&
3852 ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ) &&
3853 ( $proxysettings { 'IDENT_ENABLE_ACL' } eq 'on' ) &&
3854 ( $proxysettings { 'IDENT_USER_ACL' } eq 'positive' ) &&
3855 (!- z
" $identdir /identauth.allowusers" )
3859 print FILE
" for_acl_users" ;
3860 } elsif (((!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' ))) ||
3861 (( $proxysettings { 'AUTH_METHOD' } eq 'ident' ) && ( $proxysettings { 'IDENT_REQUIRED' } eq 'on' ))) {
3862 print FILE
" for_inetusers" ;
3864 if ((!( $proxysettings { 'AUTH_MAX_USERIP' } eq '' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'none' )) && (!( $proxysettings { 'AUTH_METHOD' } eq 'ident' )))
3866 print FILE
" !concurrent" ;
3868 if ( $proxysettings { 'TIME_ACCESS_MODE' } eq 'deny' ) {
3869 print FILE
" !within_timeframe" ;
3871 print FILE
" within_timeframe" ; }
3872 if ( $proxysettings { 'ENABLE_BROWSER_CHECK' } eq 'on' ) { print FILE
" with_allowed_useragents" ; }
3875 print FILE
"http_access deny all \n\n " ;
3877 if (( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' ) || ( $proxysettings { 'FORWARD_VIA' } eq 'off' ) ||
3878 (!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3880 print FILE
"#Strip HTTP Header \n " ;
3882 if ( $proxysettings { 'FORWARD_IPADDRESS' } eq 'off' )
3884 print FILE
"request_header_access X-Forwarded-For deny all \n " ;
3885 print FILE
"reply_header_access X-Forwarded-For deny all \n " ;
3887 if ( $proxysettings { 'FORWARD_VIA' } eq 'off' )
3889 print FILE
"request_header_access Via deny all \n " ;
3890 print FILE
"reply_header_access Via deny all \n " ;
3892 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3894 print FILE
"request_header_access User-Agent deny all \n " ;
3895 print FILE
"reply_header_access User-Agent deny all \n " ;
3897 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3899 print FILE
"request_header_access Referer deny all \n " ;
3900 print FILE
"reply_header_access Referer deny all \n " ;
3905 if ((!( $proxysettings { 'FAKE_USERAGENT' } eq '' )) || (!( $proxysettings { 'FAKE_REFERER' } eq '' )))
3907 if (!( $proxysettings { 'FAKE_USERAGENT' } eq '' ))
3909 print FILE
"header_replace User-Agent $proxysettings {'FAKE_USERAGENT'} \n " ;
3911 if (!( $proxysettings { 'FAKE_REFERER' } eq '' ))
3913 print FILE
"header_replace Referer $proxysettings {'FAKE_REFERER'} \n " ;
3919 if ( $proxysettings { 'SUPPRESS_VERSION' } eq 'on' ) { print FILE
"httpd_suppress_version_string on \n\n " }
3921 if ((!- z
$mimetypes ) && ( $proxysettings { 'ENABLE_MIME_FILTER' } eq 'on' )) {
3922 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"http_reply_access allow IPFire_unrestricted_ips \n " ; }
3923 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"http_reply_access allow IPFire_unrestricted_mac \n " ; }
3924 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3926 if (!- z
$extgrp ) { print FILE
"http_reply_access allow for_extended_users \n " ; }
3928 print FILE
"http_reply_access deny blocked_mimetypes \n " ;
3929 print FILE
"http_reply_access allow all \n\n " ;
3932 if ( $proxysettings { 'CACHE_SIZE' } > 0 )
3935 maximum_object_size $proxysettings {'MAX_SIZE'} KB
3936 minimum_object_size $proxysettings {'MIN_SIZE'} KB
3940 } else { print FILE
"cache deny all \n\n " ; }
3943 request_body_max_size $proxysettings {'MAX_OUTGOING_SIZE'} KB
3946 if ( $proxysettings { 'MAX_INCOMING_SIZE' } > 0 ) {
3947 if (!- z
$acl_src_unrestricted_ip ) { print FILE
"reply_body_max_size none IPFire_unrestricted_ips \n " ; }
3948 if (!- z
$acl_src_unrestricted_mac ) { print FILE
"reply_body_max_size none IPFire_unrestricted_mac \n " ; }
3949 if ( $proxysettings { 'AUTH_METHOD' } eq 'ncsa' )
3951 if (!- z
$extgrp ) { print FILE
"reply_body_max_size none for_extended_users \n " ; }
3955 if ( $proxysettings { 'MAX_INCOMING_SIZE' } != '0' )
3957 print FILE
"reply_body_max_size $proxysettings {'MAX_INCOMING_SIZE'} KB all \n\n " ;
3960 print FILE
"visible_hostname" ;
3961 if ( $proxysettings { 'VISIBLE_HOSTNAME' } eq '' )
3963 print FILE
" $mainsettings {'HOSTNAME'}. $mainsettings {'DOMAINNAME'} \n\n " ;
3965 print FILE
" $proxysettings {'VISIBLE_HOSTNAME'} \n\n " ;
3968 if (!( $proxysettings { 'ADMIN_MAIL_ADDRESS' } eq '' )) { print FILE
"cache_mgr $proxysettings {'ADMIN_MAIL_ADDRESS'} \n " ; }
3969 if (!( $proxysettings { 'ADMIN_PASSWORD' } eq '' )) { print FILE
"cachemgr_passwd $proxysettings {'ADMIN_PASSWORD'} all \n " ; }
3972 print FILE
"max_filedescriptors $proxysettings {'FILEDESCRIPTORS'} \n\n " ;
3974 # Write the parent proxy info, if needed.
3975 if ( $remotehost ne '' )
3977 print FILE
"cache_peer $remotehost parent $remoteport 3130 default no-query" ;
3979 # Enter authentication for the parent cache. Option format is
3980 # login=user:password ($proxy1='YES')
3981 # login=PASS ($proxy1='PASS')
3982 # login=*:password ($proxysettings{'FORWARD_USERNAME'} eq 'on')
3983 if (( $proxy1 eq 'YES' ) || ( $proxy1 eq 'PASS' ))
3985 print FILE
" login= $proxysettings {'UPSTREAM_USER'}" ;
3986 if ( $proxy1 eq 'YES' ) { print FILE
": $proxysettings {'UPSTREAM_PASSWORD'}" ; }
3988 elsif ( $proxysettings { 'FORWARD_USERNAME' } eq 'on' ) { print FILE
" login=*:password" ; }
3990 print FILE
" \n always_direct allow IPFire_ips \n " ;
3991 print FILE
"never_direct allow all \n\n " ;
3993 if (( $proxysettings { 'ENABLE_FILTER' } eq 'on' ) || ( $proxysettings { 'ENABLE_UPDXLRATOR' } eq 'on' ) || ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ))
3995 print FILE
"url_rewrite_program /usr/sbin/redirect_wrapper \n " ;
3996 print FILE
"url_rewrite_children $proxysettings {'CHILDREN'} \n\n " ;
3999 # Include file with user defined settings.
4000 if (- e
"/etc/squid/squid.conf.local" ) {
4001 print FILE
"include /etc/squid/squid.conf.local \n " ;
4005 # Proxy settings for squidclamav - if installed.
4007 # Check if squidclamav is enabled.
4008 if ( $proxysettings { 'ENABLE_CLAMAV' } eq 'on' ) {
4010 my $configfile = '/etc/squidclamav.conf' ;
4012 my $data = & General
:: read_file_utf8
( $configfile );
4013 $data =~ s/squid_port [0-9]+/squid_port $proxysettings{'PROXY_PORT'}/g ;
4014 & General
:: write_file_utf8
( $configfile , $data );
4018 # -------------------------------------------------------------------
4022 my ( $str_user , $str_pass , $str_group ) = @_ ;
4023 my @groupmembers =();
4025 if ( $str_pass eq 'lEaVeAlOnE' )
4027 open ( FILE
, " $userdb " );
4028 @groupmembers = < FILE
>;
4030 foreach $line ( @groupmembers ) { if ( $line =~ /^$str_user:/i ) { $str_pass = substr ( $line , index ( $line , ":" )); } }
4031 & deluser
( $str_user );
4032 open ( FILE
, ">> $userdb " );
4034 print FILE
" $str_user $str_pass " ;
4037 & deluser
( $str_user );
4038 system ( "/usr/sbin/htpasswd -b $userdb $str_user $str_pass " );
4041 if ( $str_group eq 'standard' ) { open ( FILE
, ">> $stdgrp " );
4042 } elsif ( $str_group eq 'extended' ) { open ( FILE
, ">> $extgrp " );
4043 } elsif ( $str_group eq 'disabled' ) { open ( FILE
, ">> $disgrp " ); }
4045 print FILE
" $str_user \n " ;
4051 # -------------------------------------------------------------------
4055 my ( $str_user ) = @_ ;
4057 my @groupmembers =();
4060 foreach $groupfile ( $stdgrp , $extgrp , $disgrp )
4063 open ( FILE
, " $groupfile " );
4064 @groupmembers = < FILE
>;
4066 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user$/i )) { push ( @templist , $line ); } }
4067 open ( FILE
, "> $groupfile " );
4069 print FILE
@templist ;
4074 open ( FILE
, " $userdb " );
4075 @groupmembers = < FILE
>;
4077 foreach $line ( @groupmembers ) { if (!( $line =~ /^$str_user:/i )) { push ( @templist , $line ); } }
4078 open ( FILE
, "> $userdb " );
4080 print FILE
@templist ;
4086 # -------------------------------------------------------------------
4090 open ( FILE
, ">${General::swroot}/proxy/cachemgr.conf" );
4092 print FILE
" $netsettings {'GREEN_ADDRESS'}: $proxysettings {'PROXY_PORT'} \n " ;
4093 print FILE
"localhost" ;
4098 # -------------------------------------------------------------------