From f4fbb93510d52300ce7140227804f38e08cf332c Mon Sep 17 00:00:00 2001 From: Erik Kapfer Date: Thu, 13 Nov 2014 10:40:42 +0100 Subject: [PATCH] OpenVPN: Added 'valid til (days)' field for N2N. Fixes #10680 --- html/cgi-bin/ovpnmain.cgi | 36 +++++++++++++++++++++--------------- langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 969b2557ff..52db3255cd 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -4014,6 +4014,10 @@ if ($cgiparams{'TYPE'} eq 'net') { $errormessage = $Lang::tr{'passwords do not match'}; goto VPNCONF_ERROR; } + if ($cgiparams{'DAYS_VALID'} ne '' && $cgiparams{'DAYS_VALID'} !~ /^[0-9]+$/) { + $errormessage = $Lang::tr{'invalid input for valid till days'}; + goto VPNCONF_ERROR; + } # Replace empty strings with a . (my $ou = $cgiparams{'CERT_OU'}) =~ s/^\s*$/\./; @@ -4284,6 +4288,7 @@ if ($cgiparams{'TYPE'} eq 'net') { $cgiparams{'CERT_CITY'} = $vpnsettings{'ROOTCERT_CITY'}; $cgiparams{'CERT_STATE'} = $vpnsettings{'ROOTCERT_STATE'}; $cgiparams{'CERT_COUNTRY'} = $vpnsettings{'ROOTCERT_COUNTRY'}; + $cgiparams{'DAYS_VALID'} = $vpnsettings{'DAYS_VALID'}; } VPNCONF_ERROR: @@ -4645,27 +4650,28 @@ END if ($cgiparams{'TYPE'} eq 'host') { print < - -  $Lang::tr{'valid till'} (days): - -   + +  $Lang::tr{'valid till'} (days): + +   $Lang::tr{'pkcs12 file password'}: -  $Lang::tr{'pkcs12 file password'}:
($Lang::tr{'confirmation'}) +  $Lang::tr{'pkcs12 file password'}:
($Lang::tr{'confirmation'}) -   -
- * $Lang::tr{'this field may be blank'} - +   +
+ * $Lang::tr{'this field may be blank'} + END }else{ print < -     -     -
- * $Lang::tr{'this field may be blank'} + +  $Lang::tr{'valid till'} (days): + +     +     +
+ * $Lang::tr{'this field may be blank'} END diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index b7692ee7b7..1aac91ddc4 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1295,6 +1295,7 @@ 'invalid input for organization' => 'Ungültige Eingabe für Organisation', 'invalid input for remote host/ip' => 'Ungültige Eingabe für Remote Host/IP', 'invalid input for state or province' => 'Ungültige Eingabe für Bundesstaat oder Provinz.', +'invalid input for valid till days' => 'Ungültige Eingabe für Gültig bis (Tage).', 'invalid ip' => 'Ungültige IP-Adresse', 'invalid keep time' => 'Die Aufbewahrungszeit muss eine gültige Zahl sein', 'invalid key' => 'Ungültiger Schlüssel.', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1986409349..afcc034ebb 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1325,6 +1325,7 @@ 'invalid input for organization' => 'Invalid input for organization', 'invalid input for remote host/ip' => 'Invalid input for remote host/ip.', 'invalid input for state or province' => 'Invalid input for state or province.', +'invalid input for valid till days' => 'Invalid input for Valid till (days).', 'invalid ip' => 'Invalid IP Address', 'invalid keep time' => 'Keep time must be a valid number', 'invalid key' => 'Invalid key.', -- 2.39.2