From 38fb1109ce44b696676a0704aa62e61eb5cd4b95 Mon Sep 17 00:00:00 2001 From: Vinicius Coque Date: Wed, 28 Apr 2010 12:45:21 -0300 Subject: Fixing gettext() implementation for required fields --- usr/local/www/system.php | 2 +- usr/local/www/system_camanager.php | 20 ++++++++++-------- usr/local/www/system_certmanager.php | 40 +++++++++++++++++++++--------------- usr/local/www/system_routes_edit.php | 5 ++++- 4 files changed, 40 insertions(+), 27 deletions(-) diff --git a/usr/local/www/system.php b/usr/local/www/system.php index 0398924..7344587 100755 --- a/usr/local/www/system.php +++ b/usr/local/www/system.php @@ -106,7 +106,7 @@ if ($_POST) { /* input validation */ $reqdfields = split(" ", "hostname domain"); - $reqdfieldsn = split(",", "Hostname,Domain"); + $reqdfieldsn = array(gettext("Hostname"),gettext("Domain")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php index 94001f1..342b5e9 100644 --- a/usr/local/www/system_camanager.php +++ b/usr/local/www/system_camanager.php @@ -118,19 +118,23 @@ if ($_POST) { /* input validation */ if ($pconfig['method'] == "existing") { $reqdfields = explode(" ", "name cert"); - $reqdfieldsn = explode(",", "Descriptive name,Certificate data"); + $reqdfieldsn = array( + gettext("Descriptive name"), + gettext("Certificate data")); } if ($pconfig['method'] == "internal") { $reqdfields = explode(" ", "name keylen lifetime dn_country dn_state dn_city ". "dn_organization dn_email dn_commonname"); - $reqdfieldsn = explode(",", - gettext("Descriptive name,Key length,Lifetime,"). - gettext("Distinguished name Country Code,"). - gettext("Distinguished name State or Province,"). - gettext("Distinguished name City,"). - gettext("Distinguished name Organization,"). - gettext("Distinguished name Email Address,"). + $reqdfieldsn = array( + gettext("Descriptive name"), + gettext("Key length"), + gettext("Lifetime"), + gettext("Distinguished name Country Code"), + gettext("Distinguished name State or Province"), + gettext("Distinguished name City"), + gettext("Distinguished name Organization"), + gettext("Distinguished name Email Address"), gettext("Distinguished name Common Name")); } diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php index e7f6477..6d89950 100644 --- a/usr/local/www/system_certmanager.php +++ b/usr/local/www/system_certmanager.php @@ -150,21 +150,26 @@ if ($_POST) { if ($pconfig['method'] == "existing") { $reqdfields = explode(" ", "name cert key"); - $reqdfieldsn = explode(",", - gettext("Descriptive name,Certificate data,Key data")); + $reqdfieldsn = array( + gettext("Descriptive name"), + gettext("Certificate data"), + gettext("Key data")); } if ($pconfig['method'] == "internal") { $reqdfields = explode(" ", "name caref keylen lifetime dn_country dn_state dn_city ". "dn_organization dn_email dn_commonname"); - $reqdfieldsn = explode(",", - gettext("Descriptive name,Certificate authority,Key length,Lifetime,"). - gettext("Distinguished name Country Code,"). - gettext("Distinguished name State or Province,"). - gettext("Distinguished name City,"). - gettext("Distinguished name Organization,"). - gettext("Distinguished name Email Address,"). + $reqdfieldsn = array( + gettext("Descriptive name"), + gettext("Certificate authority"), + gettext("Key length"), + gettext("Lifetime"), + gettext("Distinguished name Country Code"), + gettext("Distinguished name State or Province"), + gettext("Distinguished name City"), + gettext("Distinguished name Organization"), + gettext("Distinguished name Email Address"), gettext("Distinguished name Common Name")); } @@ -172,13 +177,14 @@ if ($_POST) { $reqdfields = explode(" ", "name csr_keylen csr_dn_country csr_dn_state csr_dn_city ". "csr_dn_organization csr_dn_email csr_dn_commonname"); - $reqdfieldsn = explode(",", - gettext("Descriptive name,Key length,"). - gettext("Distinguished name Country Code,"). - gettext("Distinguished name State or Province,"). - gettext("Distinguished name City,"). - gettext("Distinguished name Organization,"). - gettext("Distinguished name Email Address,"). + $reqdfieldsn = array( + gettext("Descriptive name"), + gettext("Key length"), + gettext("Distinguished name Country Code"), + gettext("Distinguished name State or Province"), + gettext("Distinguished name City"), + gettext("Distinguished name Organization"), + gettext("Distinguished name Email Address"), gettext("Distinguished name Common Name")); } @@ -245,7 +251,7 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "name cert"); - $reqdfieldsn = explode(",", gettext("Descriptive name,Final Certificate data")); + $reqdfieldsn = explode(",", gettext("Descriptive name") . "," . gettext("Final Certificate data")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index 5d2d0f6..b8e7fa0 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -88,7 +88,10 @@ if ($_POST) { /* input validation */ $reqdfields = explode(" ", "network network_subnet gateway"); - $reqdfieldsn = explode(",", gettext("Destination network,Destination network bit count,Gateway")); + $reqdfieldsn = explode(",", + gettext("Destination network") . "," . + gettext("Destination network bit count") . "," . + gettext("Gateway")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); -- cgit v1.1