&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
-$filtersettings{'CHILDREN'} = '5';
-if (-e "${General::swroot}/urlfilter/settings") {
- &General::readhash("${General::swroot}/urlfilter/settings", \%filtersettings);
-}
-
-$xlratorsettings{'CHILDREN'} = '5';
-if (-e "${General::swroot}/updatexlrator/settings") {
- &General::readhash("${General::swroot}/updatexlrator/settings", \%xlratorsettings);
-}
-
&Header::showhttpheaders();
$proxysettings{'ACTION'} = '';
$proxysettings{'IDENT_USER_ACL'} = 'positive';
$proxysettings{'ENABLE_FILTER'} = 'off';
$proxysettings{'ENABLE_UPDXLRATOR'} = 'off';
+$proxysettings{'ENABLE_CLAMAV'} = 'off';
+$proxysettings{'CHILDREN'} = '5';
$ncsa_buttontext = $Lang::tr{'advproxy NCSA create user'};
{
$errormessage = $Lang::tr{'invalid maximum incoming size'};
goto ERROR;
+ }
+ if (!($proxysettings{'CHILDREN'} =~ /^\d+$/) || ($proxysettings{'CHILDREN'} < 1))
+ {
+ $errormessage = $Lang::tr{'advproxy invalid num of children'};
+ goto ERROR;
}
if ($proxysettings{'ENABLE_BROWSER_CHECK'} eq 'on')
{
$stdproxysettings{'PROXY_PORT'} = $proxysettings{'PROXY_PORT'};
$stdproxysettings{'ENABLE_FILTER'} = $proxysettings{'ENABLE_FILTER'};
$stdproxysettings{'ENABLE_UPDXLRATOR'} = $proxysettings{'ENABLE_UPDXLRATOR'};
+ $stdproxysettings{'ENABLE_CLAMAV'} = $proxysettings{'ENABLE_CLAMAV'};
&General::writehash("${General::swroot}/proxy/settings", \%stdproxysettings);
&writeconfig;
if ($proxysettings{'ENABLE'} eq 'on') {
system ('/usr/bin/touch', "${General::swroot}/proxy/enable");
system ('/usr/local/bin/squidctrl', 'enable'); }
- if ($proxysettings{'TRANSPARENT'} eq 'on') {
+ if ($proxysettings{'TRANSPARENT'} eq 'on' && $proxysettings{'ENABLE'} eq 'on') {
system ('/usr/bin/touch', "${General::swroot}/proxy/transparent"); }
if ($proxysettings{'ENABLE_BLUE'} eq 'on') {
system ('/usr/bin/touch', "${General::swroot}/proxy/enable_blue");
system ('/usr/local/bin/squidctrl', 'enable'); }
- if ($proxysettings{'TRANSPARENT_BLUE'} eq 'on') {
+ if ($proxysettings{'TRANSPARENT_BLUE'} eq 'on' && $proxysettings{'ENABLE_BLUE'} eq 'on') {
system ('/usr/bin/touch', "${General::swroot}/proxy/transparent_blue"); }
if ($proxysettings{'ACTION'} eq $Lang::tr{'advproxy save and restart'}) { system('/usr/local/bin/squidctrl restart >/dev/null 2>&1'); }
$checked{'ENABLE_UPDXLRATOR'}{'on'} = '';
$checked{'ENABLE_UPDXLRATOR'}{$proxysettings{'ENABLE_UPDXLRATOR'}} = "checked='checked'";
+$checked{'ENABLE_CLAMAV'}{'off'} = '';
+$checked{'ENABLE_CLAMAV'}{'on'} = '';
+$checked{'ENABLE_CLAMAV'}{$proxysettings{'ENABLE_CLAMAV'}} = "checked='checked'";
+
&Header::openpage($Lang::tr{'advproxy advanced web proxy configuration'}, 1, '');
&Header::openbigbox('100%', 'left', '', $errormessage);
</table>
<hr size='1'>
<table width='100%'>
-<tr>
- <td class='base' width='50%'><b>$Lang::tr{'advproxy url filter'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_FILTER' $checked{'ENABLE_FILTER'}{'on'} /></td>
- <td class='base' width='50%'><b>$Lang::tr{'advproxy update accelerator'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_UPDXLRATOR' $checked{'ENABLE_UPDXLRATOR'}{'on'} /></td>
+<tr><td class='base' width='50%' ><b>$Lang::tr{'advproxy redirector children'}</b><input type='text' name='CHILDREN' value='$proxysettings{'CHILDREN'}' size='5' /></td>
+END
+;
+if ( -e "/usr/bin/squidclamav" ) {
+ print "<td class='base' width='33%'><b>$Lang::tr{'advproxy squidclamav'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_CLAMAV' $checked{'ENABLE_CLAMAV'}{'on'} /></td></tr>";
+}
+else
+{
+ print "<td class='base' width='33%'></td></tr>";
+}
+print <<END
</tr>
+<tr><td class='base' width='50%'><b>$Lang::tr{'advproxy url filter'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_FILTER' $checked{'ENABLE_FILTER'}{'on'} /></td>
+<td class='base' width='50%'><b>$Lang::tr{'advproxy update accelerator'}</b> $Lang::tr{'advproxy enabled'}<input type='checkbox' name='ENABLE_UPDXLRATOR' $checked{'ENABLE_UPDXLRATOR'}{'on'} /></td></tr>
</table>
<hr size='1'>
<table width='100%'>
if ($proxysettings{'AUTH_REALM'} eq '')
{
- $authrealm = "IPCop Advanced Proxy Server";
+ $authrealm = "IPFire Advanced Proxy Server";
} else {
$authrealm = $proxysettings{'AUTH_REALM'};
}
print FILE "\nnever_direct allow all\n\n";
}
- if (($proxysettings{'ENABLE_FILTER'} eq 'on') && ($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on'))
+ if (($proxysettings{'ENABLE_FILTER'} eq 'on') || ($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on') || ($proxysettings{'ENABLE_CLAMAV'} eq 'on'))
{
print FILE "url_rewrite_program /usr/sbin/redirect_wrapper\n";
- if ($filtersettings{'CHILDREN'} > $xlratorsettings{'CHILDREN'})
- {
- print FILE "url_rewrite_children $filtersettings{'CHILDREN'}\n\n";
- } else {
- print FILE "url_rewrite_children $xlratorsettings{'CHILDREN'}\n\n";
- }
- } else
- {
-
- if ($proxysettings{'ENABLE_FILTER'} eq 'on')
- {
- print FILE <<END
-url_rewrite_program /usr/bin/squidGuard
-url_rewrite_children $filtersettings{'CHILDREN'}
-
-END
- ;
- }
- if ($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on')
- {
- print FILE <<END
-url_rewrite_program /usr/sbin/updxlrator
-url_rewrite_children $xlratorsettings{'CHILDREN'}
-
-END
- ;
- }
+ print FILE "url_rewrite_children $proxysettings{'CHILDREN'}\n\n";
}
close FILE;
}
close(FILE);
} else {
&deluser($str_user);
- system("/usr/bin/htpasswd -b $userdb $str_user $str_pass");
+ system("/usr/sbin/htpasswd -b $userdb $str_user $str_pass");
}
if ($str_group eq 'standard') { open(FILE, ">>$stdgrp");