]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - html/cgi-bin/ovpnmain.cgi
VPN Checksubnets: Now the remote subnets (OpenVPN/IPSec) are checked. If they are...
[people/teissler/ipfire-2.x.git] / html / cgi-bin / ovpnmain.cgi
index 557cf72224e953a977a27bb9d1028133d2d8acc0..c315e9e5eb04f5eae1c48bce25328e78c831f2ec 100644 (file)
@@ -2159,7 +2159,7 @@ if ($confighash{$cgiparams{'KEY'}}[3] eq 'net') {
     } else {
        $errormessage = $Lang::tr{'invalid key'};
     }
-
+       &General::firewall_reload();
 
 ###
 ### Download PKCS12 file
@@ -2548,7 +2548,7 @@ END
                print"<td>$ccdconf[0]</td><td align='center'>$ccdconf[1]</td><td align='center'>$ccdhosts/".(&ccdmaxclients($ccdconf[1])+1)."</td><td>";
 print <<END
                <form method='post' />
-               <input type='image' src='/images/edit.gif' align='middle' alt=$Lang::tr{'edit'} title=$Lang::tr{'edit'} />
+               <input type='image' src='/images/edit.gif' align='middle' alt='$Lang::tr{'edit'}' title='$Lang::tr{'edit'}' />
                <input type='hidden' name='ACTION' value='edit'/>
                <input type='hidden' name='ccdname' value='$ccdconf[0]' />
                <input type='hidden' name='ccdsubnet' value='$ccdconf[1]' />
@@ -2557,7 +2557,7 @@ print <<END
                <td><input type='hidden' name='ACTION' value='kill'/>
                <input type='hidden' name='number' value='$count' />
                <input type='hidden' name='net' value='$ccdconf[0]' />
-               <input type='image' src='/images/delete.gif' align='middle' alt=$Lang::tr{'remove'} title=$Lang::tr{'remove'} /></form></td></tr>
+               <input type='image' src='/images/delete.gif' align='middle' alt='$Lang::tr{'remove'}' title='$Lang::tr{'remove'}' /></form></td></tr>
 END
 ;
        }       
@@ -3509,8 +3509,13 @@ if ($cgiparams{'TYPE'} eq 'net') {
                  unlink ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}/$cgiparams{'NAME'}.conf") or die "Removing Configfile fail: $!";
            rmdir ("${General::swroot}/ovpn/n2nconf/$cgiparams{'NAME'}") || die "Removing Directory fail: $!";
                  goto VPNCONF_ERROR;
-               }
-   
+       }
+       #Check if remote subnet is used elsewhere
+       my ($n2nip,$n2nsub)=split("/",$cgiparams{'REMOTE_SUBNET'});
+       $warnmessage=&General::checksubnets('',$n2nip,'ovpn');
+       if ($warnmessage){
+               $warnmessage=$Lang::tr{'remote subnet'}." ($cgiparams{'REMOTE_SUBNET'}) <br>".$warnmessage;
+       }
 }
 
 #      if (($cgiparams{'TYPE'} eq 'net') && ($cgiparams{'SIDE'} !~ /^(left|right)$/)) {
@@ -4569,6 +4574,16 @@ END
        &Header::closebox();
     }
 
+       if ($warnmessage) {
+               &Header::openbox('100%', 'LEFT', $Lang::tr{'warning messages'});
+               print "$warnmessage<br>";
+               print "$Lang::tr{'fwdfw warn1'}<br>";
+               &Header::closebox();
+               print"<center><form method='post'><input type='submit' name='ACTION' value='ok' style='width: 5em;'></form>";
+               &Header::closepage();
+               exit 0;
+       }
+
     my $sactive = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='50%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'stopped'}</font></b></td></tr></table>";
     my $srunning = "no";
     my $activeonrun = "";