]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/proxy.cgi
GeƤndert:
[ipfire-2.x.git] / html / cgi-bin / proxy.cgi
index 73fbc392bbce3d58e5e190974109dc66477f51e1..269ce36a2fa497519c90cc6f5b80a04b908ba24e 100644 (file)
@@ -19,9 +19,6 @@ require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
 
-my $advproxyversion = `cat ${General::swroot}/proxy/advanced/version`;
-my $sysupdflagfile = "${General::swroot}/proxy/advanced/.up2date";
-
 my %proxysettings=();
 my %netsettings=();
 my %filtersettings=();
@@ -133,6 +130,12 @@ open FILE, $browserdb;
 @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>;
 close(FILE);
 
+my %filtersettings=();
+$filtersettings{'CHILDREN'} = '5';
+if (-e "${General::swroot}/urlfilter/settings") {
+       &General::readhash("${General::swroot}/urlfilter/settings", \%filtersettings);
+}
+
 &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
 
@@ -155,6 +158,7 @@ if ($updacclrtr_addon) {
 
 &Header::showhttpheaders();
 
+$proxysettings{'ENABLE_FILTER'} = 'off';
 $proxysettings{'ACTION'} = '';
 $proxysettings{'VALID'} = '';
 
@@ -341,6 +345,15 @@ if (($proxysettings{'ACTION'} eq $Lang::tr{'save'}) || ($proxysettings{'ACTION'}
                $errormessage = $Lang::tr{'invalid maximum outgoing size'};
                goto ERROR;
        }
+       if ($proxysettings{'ENABLE_FILTER'} eq 'on')
+       {
+               print FILE <<END
+redirect_program /usr/bin/squidGuard
+redirect_children $filtersettings{'CHILDREN'}
+
+END
+               ;
+       }
        if (!($proxysettings{'TIME_TO_HOUR'}.$proxysettings{'TIME_TO_MINUTE'} gt $proxysettings{'TIME_FROM_HOUR'}.$proxysettings{'TIME_FROM_MINUTE'}))
        {
                $errormessage = $Lang::tr{'advproxy errmsg time restriction'};
@@ -803,18 +816,6 @@ if ($errormessage) {
        &Header::closebox();
 }
 
-if (($advproxyversion lt $latest) && (-e $sysupdflagfile)) { unlink($sysupdflagfile); }
-
-if (!-e $sysupdflagfile) {
-       &Header::openbox('100%', 'left', $Lang::tr{'advproxy update notification'});
-       print "<table width='100%' cellpadding='5'>\n";
-       print "<tr>\n";
-       print "<td bgcolor='$hintcolour' class='base'>$Lang::tr{'advproxy update information'}</td>";
-       print "</tr>\n";
-       print "</table>\n";
-       &Header::closebox();
-}
-
 # ===================================================================
 #  Main settings
 # ===================================================================
@@ -880,6 +881,14 @@ print <<END
        </select>
        </td>
 </tr>
+<tr>
+       <td colspan='4'><hr /><b>$Lang::tr{'urlfilter url filter'}</b></td>
+</tr>
+<tr>
+       <td width='25%' class='base'>$Lang::tr{'urlfilter enabled'}</td>
+       <td><input type='checkbox' name='ENABLE_FILTER' $checked{'ENABLE_FILTER'}{'on'} /></td>
+       <td colspan='2'>&nbsp;</td>
+</tr>
 </table>
 <hr size='1'>
 <table width='100%'>
@@ -1429,23 +1438,6 @@ print <<END
 END
 ;
 
-if ($urlfilter_addon) {
-       print <<END
-<table width='100%'>
-<tr>
-        <td colspan='4'><b>$Lang::tr{'advproxy url filter'}</b></td>
-</tr>
-<tr>
-        <td class='base' width='25%'>$Lang::tr{'advproxy enabled'}:</td>
-        <td><input type='checkbox' name='ENABLE_FILTER' $checked{'ENABLE_FILTER'}{'on'} /></td>
-        <td>&nbsp;</td>
-        <td>&nbsp;</td>
-</tr>
-</table>
-<hr size='1'>
-END
-; }
-
 if (($updacclrtr_addon) && (!($urlfilter_addon))) {
        print <<END
 <table width='100%'>
@@ -1986,7 +1978,7 @@ print <<END
        <font class='base'>$Lang::tr{'this field may be blank'}</font>
        </td>
        <td align='right'>
-       <sup><small><a href='http://www.advproxy.net' target='_blank'>Advanced Proxy $advproxyversion</a></small></sup>
+       &nbsp;
        </td>
 </tr>
 </table>
@@ -3429,7 +3421,7 @@ END
                if ($proxysettings{'ENABLE_FILTER'} eq 'on')
                {
                        print FILE <<END
-redirect_program /usr/sbin/squidGuard
+redirect_program /usr/bin/squidGuard
 redirect_children $filtersettings{'CHILDREN'}
 
 END