]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
vpnmain.cgi: Move advanced IPsec settings to connection page
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 10 Dec 2018 16:44:06 +0000 (16:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Feb 2019 18:20:36 +0000 (18:20 +0000)
This is required to make the initial setup easier for GRE/VTI connections

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
12 files changed:
doc/language_issues.de
doc/language_issues.en
doc/language_issues.es
doc/language_issues.fr
doc/language_issues.it
doc/language_issues.nl
doc/language_issues.pl
doc/language_issues.ru
doc/language_issues.tr
doc/language_missings
html/cgi-bin/vpnmain.cgi
langs/en/cgi-bin/en.pl

index c72cc40b910473473521120560304cb0ca0c98c1..f39adbec1c67872a7001e08949ecbf74a919b6b2 100644 (file)
@@ -732,7 +732,6 @@ WARNING: untranslated string: Scan for Songs = unknown string
 WARNING: untranslated string: addons = Addons
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: community rules = Snort/VRT GPLv2 Community Rules
 WARNING: untranslated string: addons = Addons
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: community rules = Snort/VRT GPLv2 Community Rules
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: emerging rules = Emergingthreats.net Community Rules
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: emerging rules = Emergingthreats.net Community Rules
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
@@ -785,6 +784,7 @@ WARNING: untranslated string: ipsec interface mode none = - None (Default) -
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: none = none
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: none = none
index efc4fce1f36ca8600286e458fe6ac2470c726c30..ce1e12d3beff92ed0bc2d7f8f46261d99fe94aeb 100644 (file)
@@ -505,7 +505,6 @@ WARNING: untranslated string: crl = Certificate Revocation List
 WARNING: untranslated string: cron server = CRON Server
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: cron server = CRON Server
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: current = Current
 WARNING: untranslated string: current aliases = Current aliases
 WARNING: untranslated string: current class = Current class
 WARNING: untranslated string: current = Current
 WARNING: untranslated string: current aliases = Current aliases
 WARNING: untranslated string: current class = Current class
@@ -1138,6 +1137,7 @@ WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: iptmangles = IPTable Mangles
 WARNING: untranslated string: iptnats = IPTable Network Address Translation
 WARNING: untranslated string: ipts = iptables
 WARNING: untranslated string: iptmangles = IPTable Mangles
 WARNING: untranslated string: iptnats = IPTable Network Address Translation
 WARNING: untranslated string: ipts = iptables
index 6994a9e92ee815341bb11d389ca552b10ccd3a70..d1c3887c313da4ec32b9d497afac8458d7a28add 100644 (file)
@@ -758,7 +758,6 @@ WARNING: untranslated string: country codes and flags = Country Codes and Flags:
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
@@ -1068,6 +1067,7 @@ WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
index 42ef8d5c75830fd0a52756b3a9ebf284a7091ffe..8b31f61efedd393aa74ea1ba5713c0c85e217cdc 100644 (file)
@@ -769,7 +769,6 @@ WARNING: translation string unused: yearly firewallhits
 WARNING: untranslated string: Captive clients = unknown string
 WARNING: untranslated string: Scan for Songs = unknown string
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: Captive clients = unknown string
 WARNING: untranslated string: Scan for Songs = unknown string
 WARNING: untranslated string: bytes = unknown string
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: fwhost err hostip = unknown string
 WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: fwhost err hostip = unknown string
@@ -821,6 +820,7 @@ WARNING: untranslated string: ipsec interface mode none = - None (Default) -
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: pakfire ago = ago.
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: pakfire ago = ago.
index 04676a98545273207bd96d65422fbfd13e719cf9..ca7a07d64fc99e239b1ebb7c5273153f16597a11 100644 (file)
@@ -788,7 +788,6 @@ WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: check all = Check all
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: check all = Check all
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dhcp dns enable update = Enable DNS Update (RFC2136):
 WARNING: untranslated string: dhcp dns key name = Key Name:
 WARNING: untranslated string: dhcp dns update = DNS Update
 WARNING: untranslated string: dhcp dns enable update = Enable DNS Update (RFC2136):
 WARNING: untranslated string: dhcp dns key name = Key Name:
 WARNING: untranslated string: dhcp dns update = DNS Update
@@ -898,6 +897,7 @@ WARNING: untranslated string: ipsec interface mode none = - None (Default) -
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: log server protocol = protocol:
 WARNING: untranslated string: masquerade blue = Masquerade BLUE
 WARNING: untranslated string: masquerade green = Masquerade GREEN
 WARNING: untranslated string: log server protocol = protocol:
 WARNING: untranslated string: masquerade blue = Masquerade BLUE
 WARNING: untranslated string: masquerade green = Masquerade GREEN
index 22b5f8433094bc0da1a653450a048db4b180b2dc..cc966b650233593d179ab3592fc0248adb9755c9 100644 (file)
@@ -785,7 +785,6 @@ WARNING: untranslated string: capabilities = Capabilities
 WARNING: untranslated string: check all = Check all
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: check all = Check all
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: dh = Diffie-Hellman parameters
 WARNING: untranslated string: dh key move failed = Diffie-Hellman parameters move failed.
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: dh = Diffie-Hellman parameters
 WARNING: untranslated string: dh key move failed = Diffie-Hellman parameters move failed.
@@ -912,6 +911,7 @@ WARNING: untranslated string: ipsec interface mode none = - None (Default) -
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: log server protocol = protocol:
 WARNING: untranslated string: masquerade blue = Masquerade BLUE
 WARNING: untranslated string: masquerade green = Masquerade GREEN
 WARNING: untranslated string: log server protocol = protocol:
 WARNING: untranslated string: masquerade blue = Masquerade BLUE
 WARNING: untranslated string: masquerade green = Masquerade GREEN
index 6994a9e92ee815341bb11d389ca552b10ccd3a70..d1c3887c313da4ec32b9d497afac8458d7a28add 100644 (file)
@@ -758,7 +758,6 @@ WARNING: untranslated string: country codes and flags = Country Codes and Flags:
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
@@ -1068,6 +1067,7 @@ WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
index 869ccd786f7b62d8afb46a1e082d1d698339da2f..3e38020703317e2b0c1f8dcfc66481033fdc0e67 100644 (file)
@@ -761,7 +761,6 @@ WARNING: untranslated string: country codes and flags = Country Codes and Flags:
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: countrycode = Code
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
 WARNING: untranslated string: dead peer detection = Dead Peer Detection
 WARNING: untranslated string: default = Default
 WARNING: untranslated string: deprecated fs warn = Deprecated filesystem! Newer kernel drop the support. Backup and reformat!
@@ -1070,6 +1069,7 @@ WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec network = IPsec network
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
 WARNING: untranslated string: last = Last
 WARNING: untranslated string: least preferred = least preferred
 WARNING: untranslated string: lifetime = Lifetime:
index c455234411f79ecbdc16978a4f28401335856058..67b43043d68c0a58e317c26c5773cc177262af1b 100644 (file)
@@ -771,7 +771,6 @@ WARNING: untranslated string: Scan for Songs = unknown string
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
 WARNING: untranslated string: bytes = unknown string
 WARNING: untranslated string: crypto error = Cryptographic error
 WARNING: untranslated string: crypto warning = Cryptographic warning
-WARNING: untranslated string: cryptographic settings = Cryptographic Settings
 WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwdfw all subnets = All subnets
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
 WARNING: untranslated string: dnsforward forward_servers = Nameservers
 WARNING: untranslated string: fwdfw all subnets = All subnets
 WARNING: untranslated string: fwhost cust geoipgrp = unknown string
@@ -824,6 +823,7 @@ WARNING: untranslated string: ipsec interface mode none = - None (Default) -
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
 WARNING: untranslated string: ipsec interface mode vti = VTI
 WARNING: untranslated string: ipsec mode transport = Transport
 WARNING: untranslated string: ipsec mode tunnel = Tunnel
+WARNING: untranslated string: ipsec settings = IPsec Settings
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: ovpn error dh = The Diffie-Hellman parameter needs to be in minimum 2048 bit! <br>Please generate or upload a new Diffie-Hellman parameter, this can be made below in the section "Diffie-Hellman parameters options".</br>
 WARNING: untranslated string: mtu = MTU
 WARNING: untranslated string: no data = unknown string
 WARNING: untranslated string: ovpn error dh = The Diffie-Hellman parameter needs to be in minimum 2048 bit! <br>Please generate or upload a new Diffie-Hellman parameter, this can be made below in the section "Diffie-Hellman parameters options".</br>
index a770c13b2806df31764154fe7293b99e19f84364..0b067578ba4aeaf2ea3829b6be84055b7eead300 100644 (file)
@@ -49,6 +49,7 @@
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
+< ipsec settings
 < mtu
 < none
 < notes
 < mtu
 < none
 < notes
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
+< ipsec settings
 < last
 < least preferred
 < lifetime
 < last
 < least preferred
 < lifetime
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
+< ipsec settings
 < mtu
 < subnet mask
 ############################################################################
 < mtu
 < subnet mask
 ############################################################################
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
+< ipsec settings
 < log server protocol
 < masquerade blue
 < masquerade green
 < log server protocol
 < masquerade blue
 < masquerade green
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
+< ipsec settings
 < log server protocol
 < masquerade blue
 < masquerade green
 < log server protocol
 < masquerade blue
 < masquerade green
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
+< ipsec settings
 < last
 < least preferred
 < lifetime
 < last
 < least preferred
 < lifetime
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
 < ipsec mode tunnel
 < ipsec network
 < ipsec no connections
+< ipsec settings
 < last
 < least preferred
 < lifetime
 < last
 < least preferred
 < lifetime
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
 < ipsec interface mode vti
 < ipsec mode transport
 < ipsec mode tunnel
+< ipsec settings
 < mtu
 < ovpn error dh
 < ovpn error md5
 < mtu
 < ovpn error dh
 < ovpn error md5
index f6791c70b245b7c4c217507267d9c2a0975126c1..0488f70c5805e80ac7d4d900fb005fd7bb1ba7e3 100644 (file)
@@ -1447,6 +1447,26 @@ END
                                        goto VPNCONF_ERROR;
                                }
                        }
                                        goto VPNCONF_ERROR;
                                }
                        }
+
+                       if ($cgiparams{'MODE'} !~ /^(tunnel|transport)$/) {
+                               $errormessage = $Lang::tr{'invalid input for mode'};
+                               goto VPNCONF_ERROR;
+                       }
+
+                       if ($cgiparams{'INTERFACE_MODE'} !~ /^(|gre|vti)$/) {
+                               $errormessage = $Lang::tr{'invalid input for interface mode'};
+                               goto VPNCONF_ERROR;
+                       }
+
+                       if (($cgiparams{'INTERFACE_MODE'} ne "") && !&Network::check_subnet($cgiparams{'INTERFACE_ADDRESS'})) {
+                               $errormessage = $Lang::tr{'invalid input for interface address'};
+                               goto VPNCONF_ERROR;
+                       }
+
+                       if ($cgiparams{'INTERFACE_MTU'} !~ /^\d+$/) {
+                               $errormessage = $Lang::tr{'invalid input for interface mtu'};
+                               goto VPNCONF_ERROR;
+                       }
                }
 
                if ($cgiparams{'ENABLED'} !~ /^(on|off)$/) {
                }
 
                if ($cgiparams{'ENABLED'} !~ /^(on|off)$/) {
@@ -1997,6 +2017,15 @@ VPNCONF_ERROR:
        $checked{'AUTH'}{'auth-dn'} = '';
        $checked{'AUTH'}{$cgiparams{'AUTH'}} = "checked='checked'";
 
        $checked{'AUTH'}{'auth-dn'} = '';
        $checked{'AUTH'}{$cgiparams{'AUTH'}} = "checked='checked'";
 
+       $selected{'MODE'}{'tunnel'} = '';
+       $selected{'MODE'}{'transport'} = '';
+       $selected{'MODE'}{$cgiparams{'MODE'}} = "selected='selected'";
+
+       $selected{'INTERFACE_MODE'}{''} = '';
+       $selected{'INTERFACE_MODE'}{'gre'} = '';
+       $selected{'INTERFACE_MODE'}{'vti'} = '';
+       $selected{'INTERFACE_MODE'}{$cgiparams{'INTERFACE_MODE'}} = "selected='selected'";
+
        &Header::showhttpheaders();
        &Header::openpage($Lang::tr{'ipsec'}, 1, '');
        &Header::openbigbox('100%', 'left', '', $errormessage);
        &Header::showhttpheaders();
        &Header::openpage($Lang::tr{'ipsec'}, 1, '');
        &Header::openbigbox('100%', 'left', '', $errormessage);
@@ -2034,10 +2063,6 @@ VPNCONF_ERROR:
        <input type='hidden' name='DPD_TIMEOUT' value='$cgiparams{'DPD_TIMEOUT'}' />
        <input type='hidden' name='FORCE_MOBIKE' value='$cgiparams{'FORCE_MOBIKE'}' />
        <input type='hidden' name='INACTIVITY_TIMEOUT' value='$cgiparams{'INACTIVITY_TIMEOUT'}' />
        <input type='hidden' name='DPD_TIMEOUT' value='$cgiparams{'DPD_TIMEOUT'}' />
        <input type='hidden' name='FORCE_MOBIKE' value='$cgiparams{'FORCE_MOBIKE'}' />
        <input type='hidden' name='INACTIVITY_TIMEOUT' value='$cgiparams{'INACTIVITY_TIMEOUT'}' />
-       <input type='hidden' name='MODE' value='$cgiparams{'MODE'}' />
-       <input type='hidden' name='INTERFACE_MODE' value='$cgiparams{'INTERFACE_MODE'}' />
-       <input type='hidden' name='INTERFACE_ADDRESS' value='$cgiparams{'INTERFACE_ADDRESS'}' />
-       <input type='hidden' name='INTERFACE_MTU' value='$cgiparams{'INTERFACE_MTU'}' />
 END
 ;
        if ($cgiparams{'KEY'}) {
 END
 ;
        if ($cgiparams{'KEY'}) {
@@ -2120,6 +2145,51 @@ END
        print "</table>";
        &Header::closebox();
 
        print "</table>";
        &Header::closebox();
 
+       if ($cgiparams{'TYPE'} eq 'net') {
+               &Header::openbox('100%', 'left', $Lang::tr{'ipsec settings'});
+               print <<EOF;
+               <table width='100%'>
+                       <tbody>
+                               <tr>
+                                       <td class='boldbase' width='20%'>$Lang::tr{'mode'}:</td>
+                                       <td width='30%'>
+                                               <select name='MODE'>
+                                                       <option value='tunnel' $selected{'MODE'}{'tunnel'}>$Lang::tr{'ipsec mode tunnel'}</option>
+                                                       <option value='transport' $selected{'MODE'}{'transport'}>$Lang::tr{'ipsec mode transport'}</option>
+                                               </select>
+                                       </td>
+                                       <td colspan='2'></td>
+                               </tr>
+
+                               <tr>
+                                       <td class='boldbase' width='20%'>$Lang::tr{'interface mode'}:</td>
+                                       <td width='30%'>
+                                               <select name='INTERFACE_MODE'>
+                                                       <option value='' $selected{'INTERFACE_MODE'}{''}>$Lang::tr{'ipsec interface mode none'}</option>
+                                                       <option value='gre' $selected{'INTERFACE_MODE'}{'gre'}>$Lang::tr{'ipsec interface mode gre'}</option>
+                                                       <option value='vti' $selected{'INTERFACE_MODE'}{'vti'}>$Lang::tr{'ipsec interface mode vti'}</option>
+                                               </select>
+                                       </td>
+
+                                       <td class='boldbase' width='20%'>$Lang::tr{'ip address'}/$Lang::tr{'subnet mask'}:</td>
+                                       <td width='30%'>
+                                               <input type="text" name="INTERFACE_ADDRESS" value="$cgiparams{'INTERFACE_ADDRESS'}">
+                                       </td>
+                               </tr>
+
+                               <tr>
+                                       <td class='boldbase' width='20%'>$Lang::tr{'mtu'}:</td>
+                                       <td width='30%'>
+                                               <input type="number" name="INTERFACE_MTU" value="$cgiparams{'INTERFACE_MTU'}" min="576" max="9000">
+                                       </td>
+                                       <td colspan='2'></td>
+                               </tr>
+                       </tbody>
+               </table>
+EOF
+               &Header::closebox();
+       }
+
        if ($cgiparams{'KEY'} && $cgiparams{'AUTH'} eq 'psk') {
                &Header::openbox('100%', 'left', $Lang::tr{'authentication'});
                print <<END
        if ($cgiparams{'KEY'} && $cgiparams{'AUTH'} eq 'psk') {
                &Header::openbox('100%', 'left', $Lang::tr{'authentication'});
                print <<END
@@ -2332,26 +2402,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
                        goto ADVANCED_ERROR;
                }
 
                        goto ADVANCED_ERROR;
                }
 
-               if ($cgiparams{'MODE'} !~ /^(tunnel|transport)$/) {
-                       $errormessage = $Lang::tr{'invalid input for mode'};
-                       goto ADVANCED_ERROR;
-               }
-
-               if ($cgiparams{'INTERFACE_MODE'} !~ /^(|gre|vti)$/) {
-                       $errormessage = $Lang::tr{'invalid input for interface mode'};
-                       goto ADVANCED_ERROR;
-               }
-
-               if (($cgiparams{'INTERFACE_MODE'} ne "") && !&Network::check_subnet($cgiparams{'INTERFACE_ADDRESS'})) {
-                       $errormessage = $Lang::tr{'invalid input for interface address'};
-                       goto ADVANCED_ERROR;
-               }
-
-               if ($cgiparams{'INTERFACE_MTU'} !~ /^\d+$/) {
-                       $errormessage = $Lang::tr{'invalid input for interface mtu'};
-                       goto ADVANCED_ERROR;
-               }
-
                $confighash{$cgiparams{'KEY'}}[29] = $cgiparams{'IKE_VERSION'};
                $confighash{$cgiparams{'KEY'}}[18] = $cgiparams{'IKE_ENCRYPTION'};
                $confighash{$cgiparams{'KEY'}}[19] = $cgiparams{'IKE_INTEGRITY'};
                $confighash{$cgiparams{'KEY'}}[29] = $cgiparams{'IKE_VERSION'};
                $confighash{$cgiparams{'KEY'}}[18] = $cgiparams{'IKE_ENCRYPTION'};
                $confighash{$cgiparams{'KEY'}}[19] = $cgiparams{'IKE_INTEGRITY'};
@@ -2371,10 +2421,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
                $confighash{$cgiparams{'KEY'}}[32] = $cgiparams{'FORCE_MOBIKE'};
                $confighash{$cgiparams{'KEY'}}[33] = $cgiparams{'START_ACTION'};
                $confighash{$cgiparams{'KEY'}}[34] = $cgiparams{'INACTIVITY_TIMEOUT'};
                $confighash{$cgiparams{'KEY'}}[32] = $cgiparams{'FORCE_MOBIKE'};
                $confighash{$cgiparams{'KEY'}}[33] = $cgiparams{'START_ACTION'};
                $confighash{$cgiparams{'KEY'}}[34] = $cgiparams{'INACTIVITY_TIMEOUT'};
-               $confighash{$cgiparams{'KEY'}}[35] = $cgiparams{'MODE'};
-               $confighash{$cgiparams{'KEY'}}[36] = $cgiparams{'INTERFACE_MODE'};
-               $confighash{$cgiparams{'KEY'}}[37] = $cgiparams{'INTERFACE_ADDRESS'};
-               $confighash{$cgiparams{'KEY'}}[38] = $cgiparams{'INTERFACE_MTU'};
                &General::writehasharray("${General::swroot}/vpn/config", \%confighash);
                &writeipsecfiles();
                if (&vpnenabled) {
                &General::writehasharray("${General::swroot}/vpn/config", \%confighash);
                &writeipsecfiles();
                if (&vpnenabled) {
@@ -2536,15 +2582,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
        }
        $selected{'INACTIVITY_TIMEOUT'}{$cgiparams{'INACTIVITY_TIMEOUT'}} = "selected";
 
        }
        $selected{'INACTIVITY_TIMEOUT'}{$cgiparams{'INACTIVITY_TIMEOUT'}} = "selected";
 
-       $selected{'MODE'}{'tunnel'} = '';
-       $selected{'MODE'}{'transport'} = '';
-       $selected{'MODE'}{$cgiparams{'MODE'}} = "selected='selected'";
-
-       $selected{'INTERFACE_MODE'}{''} = '';
-       $selected{'INTERFACE_MODE'}{'gre'} = '';
-       $selected{'INTERFACE_MODE'}{'vti'} = '';
-       $selected{'INTERFACE_MODE'}{$cgiparams{'INTERFACE_MODE'}} = "selected='selected'";
-
        &Header::showhttpheaders();
        &Header::openpage($Lang::tr{'ipsec'}, 1, '');
        &Header::openbigbox('100%', 'left', '', $errormessage);
        &Header::showhttpheaders();
        &Header::openpage($Lang::tr{'ipsec'}, 1, '');
        &Header::openbigbox('100%', 'left', '', $errormessage);
@@ -2569,45 +2606,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
        <input type='hidden' name='ADVANCED' value='yes' />
        <input type='hidden' name='KEY' value='$cgiparams{'KEY'}' />
 
        <input type='hidden' name='ADVANCED' value='yes' />
        <input type='hidden' name='KEY' value='$cgiparams{'KEY'}' />
 
-       <table width="100%">
-               <tbody>
-                       <tr>
-                               <td width="15%">$Lang::tr{'mode'}:</td>
-                               <td>
-                                       <select name='MODE'>
-                                               <option value='tunnel' $selected{'MODE'}{'tunnel'}>$Lang::tr{'ipsec mode tunnel'}</option>
-                                               <option value='transport' $selected{'MODE'}{'transport'}>$Lang::tr{'ipsec mode transport'}</option>
-                                       </select>
-                               </td>
-                               <td></td>
-                       </tr>
-
-                       <tr>
-                               <td width="15%">$Lang::tr{'interface mode'}:</td>
-                               <td>
-                                       <label></label>
-                                       <select name='INTERFACE_MODE'>
-                                               <option value='' $selected{'INTERFACE_MODE'}{''}>$Lang::tr{'ipsec interface mode none'}</option>
-                                               <option value='gre' $selected{'INTERFACE_MODE'}{'gre'}>$Lang::tr{'ipsec interface mode gre'}</option>
-                                               <option value='vti' $selected{'INTERFACE_MODE'}{'vti'}>$Lang::tr{'ipsec interface mode vti'}</option>
-                                       </select>
-                               </td>
-                               <td>
-                                       <label>$Lang::tr{'ip address'}/$Lang::tr{'subnet mask'}</label>
-                                       <input type="text" name="INTERFACE_ADDRESS" value="$cgiparams{'INTERFACE_ADDRESS'}">
-                               </td>
-                               <td>
-                                       <label>$Lang::tr{'mtu'}</label>
-                                       <input type="number" name="INTERFACE_MTU" value="$cgiparams{'INTERFACE_MTU'}" min="576" max="9000">
-                               </td>
-                       </tr>
-               </tbody>
-       </table>
-
-       <br><br>
-
-       <h2>$Lang::tr{'cryptographic settings'}</h2>
-
        <table width='100%'>
        <thead>
                <tr>
        <table width='100%'>
        <thead>
                <tr>
index d289aa783b2b75977a74106c9536f24e1df5e121..112519977104b73b027ff268eafc80a8b0d1f955 100644 (file)
 'ipsec mode tunnel' => 'Tunnel',
 'ipsec network' => 'IPsec network',
 'ipsec no connections' => 'No active IPsec connections',
 'ipsec mode tunnel' => 'Tunnel',
 'ipsec network' => 'IPsec network',
 'ipsec no connections' => 'No active IPsec connections',
+'ipsec settings' => 'IPsec Settings',
 'iptable rules' => 'IPTable rules',
 'iptmangles' => 'IPTable Mangles',
 'iptnats' => 'IPTable Network Address Translation',
 'iptable rules' => 'IPTable rules',
 'iptmangles' => 'IPTable Mangles',
 'iptnats' => 'IPTable Network Address Translation',