]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - html/cgi-bin/vpnmain.cgi
vpnmain.cgi: Added inclusion of ipsec.user-post.conf to the end of ipsec.conf in...
[ipfire-2.x.git] / html / cgi-bin / vpnmain.cgi
index 7e90649d89aa2c277f97b65f2b4ea4a9e038bbf6..d86a613d1ff3449010f83cecf606aec0f0b70a4d 100644 (file)
@@ -437,6 +437,14 @@ sub writeipsecfiles {
        }
        print CONF "\n";
     }#foreach key
+
+    # Add post user includes to config file
+    # After the GUI-connections allows to patch connections.
+    if (-e "/etc/ipsec.user-post.conf") {
+        print CONF "include /etc/ipsec.user-post.conf\n";
+        print CONF "\n";
+    }
+
     print SECRETS $last_secrets if ($last_secrets);
     close(CONF);
     close(SECRETS);
@@ -1225,7 +1233,7 @@ END
     } else {
        $errormessage = $Lang::tr{'invalid key'};
     }
-
+       &General::firewall_reload();
 ###
 ### Choose between adding a host-net or net-net connection
 ###
@@ -1407,14 +1415,13 @@ END
            goto VPNCONF_ERROR;
        }
 
-#temporary disabled (BUG 10294)
-#      if ($cgiparams{'TYPE'} eq 'net'){
-#              $errormessage=&General::checksubnets($cgiparams{'NAME'},$cgiparams{'REMOTE_SUBNET'});
-#              if ($errormessage ne ''){
-#                      goto VPNCONF_ERROR;
-#              }
-#              
-#      }
+       if ($cgiparams{'TYPE'} eq 'net'){
+               $warnmessage=&General::checksubnets('',$cgiparams{'REMOTE_SUBNET'},'ipsec');
+               if ($warnmessage ne ''){
+                       $warnmessage=$Lang::tr{'remote subnet'}." ($cgiparams{'REMOTE_SUBNET'}) <br>".$warnmessage;
+               }
+       }
+
        if ($cgiparams{'AUTH'} eq 'psk') {
            if (! length($cgiparams{'PSK'}) ) {
                $errormessage = $Lang::tr{'pre-shared key is too short'};
@@ -2520,7 +2527,7 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
                <td>
                        <label>
                                <input type='checkbox' name='ONLY_PROPOSED' $checked{'ONLY_PROPOSED'} />
-                               IKE+ESP: $Lang::tr{'use only proposed settings'}</td>
+                               IKE+ESP: $Lang::tr{'use only proposed settings'}
                        </label>
                </td>
        </tr>
@@ -2612,6 +2619,16 @@ EOF
        &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='$Lang::tr{'ok'}' style='width: 5em;'></form>";
+               &Header::closepage();
+               exit 0;
+       }
+
     &Header::openbox('100%', 'left', $Lang::tr{'global settings'});
     print <<END
     <form method='post' action='$ENV{'SCRIPT_NAME'}'>