From b79454a71b0a93e943efbce46baa2a43d15f7628 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Ramos Date: Wed, 28 Apr 2010 10:55:05 -0300 Subject: Reviewing gettext() implementation --- usr/local/www/system_usermanager.php | 70 ++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'usr') diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index c98f1cb..3dd1880 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -52,7 +52,7 @@ require("guiconfig.inc"); if (isAllowedPage("system_usermanager")) { // start admin user code - $pgtitle = array("System","User Manager"); + $pgtitle = array(gettext("System"),gettext("User Manager")); $id = $_GET['id']; if (isset($_POST['id'])) @@ -180,14 +180,14 @@ if (isAllowedPage("system_usermanager")) { /* input validation */ if (isset($id) && ($a_user[$id])) { $reqdfields = explode(" ", "usernamefld"); - $reqdfieldsn = explode(",", "Username"); + $reqdfieldsn = explode(",", gettext("Username")); } else { if (empty($_POST['name'])) { $reqdfields = explode(" ", "usernamefld passwordfld1"); - $reqdfieldsn = explode(",", "Username,Password"); + $reqdfieldsn = explode(",", gettext("Username,Password")); } else { $reqdfields = explode(" ", "usernamefld passwordfld1 name caref keylen lifetime"); - $reqdfieldsn = explode(",", "Username,Password,Descriptive name,Certificate authority,Key length,Lifetime"); + $reqdfieldsn = explode(",", gettext("Username,Password,Descriptive name,Certificate authority,Key length,Lifetime")); } } @@ -228,14 +228,14 @@ if (isAllowedPage("system_usermanager")) { $_POST['expires'] = date("m/d/Y",$expdate); } } else { - $input_errors[] = "Invalid expiration date format; use MM/DD/YYYY instead."; + $input_errors[] = gettext("Invalid expiration date format; use MM/DD/YYYY instead."); } } if (!empty($_POST['name'])) { $ca = lookup_ca($_POST['caref']); if (!$ca) - $input_errors[] = "Invalid internal Certificate Authority\n"; + $input_errors[] = sprintf("Invalid internal Certificate Authority%s", "\n"); } /* if this is an AJAX caller then handle via JSON */ @@ -463,14 +463,14 @@ function sshkeyClicked(obj) { - Expiration date + Pick a date
- Leave blank if the account shouldn't expire, otherwise enter the expiration date in the following format: mm/dd/yyyy + @@ -478,7 +478,7 @@ function sshkeyClicked(obj) { @@ -710,7 +710,7 @@ function sshkeyClicked(obj) { @@ -737,10 +737,10 @@ function sshkeyClicked(obj) {
- Not Member Of
+

- Member Of
+

- export private key + " alt="" width="17" height="17" border="0" /> - export cert + " alt="" width="17" height="17" border="0" /> ')"> delete cert @@ -650,7 +650,7 @@ function sshkeyClicked(obj) {
- Click to create a user certificate. +
- Click to paste an authorized key. +
- - - - + + + + - User + <?=gettext(" title="" border="0" height="16" width="16" /> @@ -792,17 +792,17 @@ function sshkeyClicked(obj) { @@ -825,26 +825,26 @@ function sshkeyClicked(obj) { // start normal user code - $pgtitle = array("System","User Password"); + $pgtitle = array(gettext("System"),gettext("User Password")); if (isset($_POST['save'])) { unset($input_errors); /* input validation */ $reqdfields = explode(" ", "passwordfld1"); - $reqdfieldsn = explode(",", "Password"); + $reqdfieldsn = explode(",", gettext("Password")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if ($_POST['passwordfld1'] != $_POST['passwordfld2']) - $input_errors[] = "The passwords do not match."; + $input_errors[] = gettext("The passwords do not match."); if (!$input_errors) { // all values are okay --> saving changes $config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['password'] = crypt(trim($_POST['passwordfld1'])); write_config(); - $savemsg = "Password successfully changed
"; + $savemsg = sprintf("Password successfully changed%s", "
"); } } @@ -865,7 +865,7 @@ function sshkeyClicked(obj) { print_info_box($savemsg); if($islocal == false) { - echo "Sorry, you cannot change the password for a LDAP user."; + echo gettext("Sorry, you cannot change the password for a LDAP user."); include("fend.inc"); exit; } @@ -875,10 +875,10 @@ function sshkeyClicked(obj) {
UsernameFull nameDisabledGroups
@@ -774,12 +774,12 @@ function sshkeyClicked(obj) { - edit user + " alt="" width="17" height="17" border="0" />   ')"> - delete user + " alt="" width="17" height="17" border="0" /> - add user + " alt="" width="17" height="17" border="0" />

- - - - +

- + - + -- cgit v1.1
's Password's
Password