Commit d7179953 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) simplify "edit item" check a bit and remove typo in vpn_openvpn_server.php

parent fa5778f6
...@@ -53,8 +53,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -53,8 +53,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['autokey_enable'] = "yes"; $pconfig['autokey_enable'] = "yes";
$pconfig['autotls_enable'] = "yes"; $pconfig['autotls_enable'] = "yes";
$pconfig['tlsauth_enable'] = "yes"; $pconfig['tlsauth_enable'] = "yes";
if ($act == "edit") { if ($act == "edit" && isset($id) && isset($a_server[$id])) {
if (isset($id) && isset($a_server[$id])) {
if ($a_server[$id]['mode'] != "p2p_shared_key") { if ($a_server[$id]['mode'] != "p2p_shared_key") {
$pconfig['cert_depth'] = 1; $pconfig['cert_depth'] = 1;
} }
...@@ -97,7 +96,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -97,7 +96,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} else { } else {
$pconfig['tls'] = null; $pconfig['tls'] = null;
} }
}
} elseif ($act == "new") { } elseif ($act == "new") {
$pconfig['dh_length'] = 1024; $pconfig['dh_length'] = 1024;
$pconfig['dev_mode'] = "tun"; $pconfig['dev_mode'] = "tun";
...@@ -117,7 +115,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -117,7 +115,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
,wins_server2,no_tun_ipv6,push_register_dns,dns_domain,nbdd_server1 ,wins_server2,no_tun_ipv6,push_register_dns,dns_domain,nbdd_server1
,client_mgmt_port,verbosity_level,caref,crlref,certref,dh_length ,client_mgmt_port,verbosity_level,caref,crlref,certref,dh_length
,cert_depth,strictusercn,digest,disable,duplicate_cn,vpnid,shared_key,tls"; ,cert_depth,strictusercn,digest,disable,duplicate_cn,vpnid,shared_key,tls";
foreach (explode(",",$copy_fields) as $fieldname) { foreach (explode(",",$init_fields) as $fieldname) {
$fieldname = trim($fieldname); $fieldname = trim($fieldname);
if (!isset($pconfig[$fieldname])) { if (!isset($pconfig[$fieldname])) {
$pconfig[$fieldname] = null; $pconfig[$fieldname] = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment