]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/proxy.cgi
Squid gefixt damit auch andere auth meachanismen funktionieren
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / proxy.cgi
index 05a75c3bb818466ba60edae20f0bbc87cdefba9b..ee44b0e344291dd8213e7aa8d5c5236c26d20422 100644 (file)
@@ -166,8 +166,8 @@ $proxysettings{'TRANSPARENT_BLUE'} = 'off';
 $proxysettings{'PROXY_PORT'} = '800';
 $proxysettings{'VISIBLE_HOSTNAME'} = '';
 $proxysettings{'ADMIN_MAIL_ADDRESS'} = '';
-$proxysettings{'ERR_LANGUAGE'} = 'English';
-$proxysettings{'ERR_DESIGN'} = 'IPCop';
+$proxysettings{'ERR_LANGUAGE'} = 'German';
+$proxysettings{'ERR_DESIGN'} = 'ipfire';
 $proxysettings{'SUPPRESS_VERSION'} = 'off';
 $proxysettings{'FORWARD_VIA'} = 'off';
 $proxysettings{'FORWARD_IPADDRESS'} = 'off';
@@ -900,7 +900,7 @@ print <<END
        <td><input type='checkbox' name='SUPPRESS_VERSION' $checked{'SUPPRESS_VERSION'}{'on'} /></td>
        <td class='base'>$Lang::tr{'advproxy error design'}:</td>
        <td class='base'><select name='ERR_DESIGN'>
-               <option value='ipcop' $selected{'ERR_DESIGN'}{'ipcop'}>IPCop</option>
+               <option value='ipfire' $selected{'ERR_DESIGN'}{'ipfire'}>IPFire</option>
                <option value='squid' $selected{'ERR_DESIGN'}{'squid'}>$Lang::tr{'advproxy standard'}</option>
        </select></td>
 </tr>
@@ -2166,7 +2166,7 @@ if (-e $disgrp)
 
 # If the password file contains entries, print entries and action icons
 
-if (! -z "$userdb") {
+if ( $userdb ne "" ) {
        print <<END
        <tr>
                <td width='30%' class='boldbase' align='center'><b><i>$Lang::tr{'advproxy NCSA username'}</i></b></td>
@@ -2733,7 +2733,7 @@ sub write_acls
 
 sub writepacfile
 {
-       open(FILE, ">/home/httpd/html/proxy.pac");
+       open(FILE, ">/srv/web/ipfire/html/proxy.pac");
        flock(FILE, 2);
        print FILE "function FindProxyForURL(url, host)\n";
        print FILE "{\n";
@@ -2756,9 +2756,34 @@ END
 ;
                if ($proxysettings{'ENABLE'} eq 'on')
                {
+                       print FILE "if (\n";
+                       print FILE "     (isInNet(myIpAddress(), \"$netsettings{'GREEN_NETADDRESS'}\", \"$netsettings{'GREEN_NETMASK'}\"))";
+
+                       undef @templist;
+                       if (-e "$acl_src_subnets") {
+                               open(SUBNETS,"$acl_src_subnets");
+                               @templist = <SUBNETS>;
+                               close(SUBNETS);
+                       }
+
+                       foreach (@templist)
+                       {
+                               @temp = split(/\//);
+                               if (
+                                       ($temp[0] ne $netsettings{'GREEN_NETADDRESS'}) && ($temp[1] ne $netsettings{'GREEN_NETMASK'}) && 
+                                       ($temp[0] ne $netsettings{'BLUE_NETADDRESS'}) && ($temp[1] ne $netsettings{'BLUE_NETMASK'})
+                                       )
+                               {
+                                       chomp $temp[1];
+                                       print FILE " ||\n     (isInNet(myIpAddress(), \"$temp[0]\", \"$temp[1]\"))";
+                               }
+                       }
+
+                       print FILE "\n";
+
                        print FILE <<END
-if (
-     (isInNet(myIpAddress(), "$netsettings{'GREEN_NETADDRESS'}", "$netsettings{'GREEN_NETMASK'}"))
+
+
    )
      return "PROXY $netsettings{'GREEN_ADDRESS'}:$proxysettings{'PROXY_PORT'}";
 END
@@ -2863,9 +2888,9 @@ cache_dir aufs /var/log/cache $proxysettings{'CACHE_SIZE'} $proxysettings{'L1_DI
 END
        ;
 
-       if (($proxysettings{'ERR_DESIGN'} eq 'ipcop') && ($proxysettings{'VISIBLE_HOSTNAME'} eq ''))
+       if (($proxysettings{'ERR_DESIGN'} eq 'ipfire' ))
        {
-               print FILE "error_directory $errordir.ipcop/$proxysettings{'ERR_LANGUAGE'}\n\n";
+               print FILE "error_directory $errordir.ipfire/$proxysettings{'ERR_LANGUAGE'}\n\n";
        } else {
                print FILE "error_directory $errordir/$proxysettings{'ERR_LANGUAGE'}\n\n";
        }
@@ -3150,7 +3175,7 @@ acl IPCop_no_access_mac arp "$acl_src_noaccess_mac"
 END
                ;
                print FILE "deny_info ";
-               if ((($proxysettings{'ERR_DESIGN'} eq 'ipcop') && (-e "$errordir.ipcop/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")) ||
+               if ((($proxysettings{'ERR_DESIGN'} eq 'ipfire') && (-e "$errordir.ipfire/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")) ||
                    (($proxysettings{'ERR_DESIGN'} eq 'squid') && (-e "$errordir/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")))
                {
                        print FILE "ERR_ACCESS_DISABLED";
@@ -3159,7 +3184,7 @@ END
                }
                print FILE " IPCop_no_access_ips\n";
                print FILE "deny_info ";
-               if ((($proxysettings{'ERR_DESIGN'} eq 'ipcop') && (-e "$errordir.ipcop/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")) ||
+               if ((($proxysettings{'ERR_DESIGN'} eq 'ipfire') && (-e "$errordir.ipfire/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")) ||
                    (($proxysettings{'ERR_DESIGN'} eq 'squid') && (-e "$errordir/$proxysettings{'ERR_LANGUAGE'}/ERR_ACCESS_DISABLED")))
                {
                        print FILE "ERR_ACCESS_DISABLED";