From 364343238e772f335eb0fd2c11a86a61e8e4ff8f Mon Sep 17 00:00:00 2001 From: soranzo Date: Mon, 6 Oct 2003 18:10:14 +0000 Subject: [PATCH] Third part of required+left style fixes: users.php. Also dropped doProperties() (does the same of doDefault() ) and added a check in doSaveCreate(). Italian translation update. --- lang/english.php | 3 +- lang/italian.php | 11 ++-- lang/recoded/english.php | 3 +- lang/recoded/italian.php | 11 ++-- users.php | 114 +++++++++++++++------------------------ 5 files changed, 64 insertions(+), 78 deletions(-) diff --git a/lang/english.php b/lang/english.php index 7492b470..b443d746 100755 --- a/lang/english.php +++ b/lang/english.php @@ -4,7 +4,7 @@ * English language file for phpPgAdmin. Use this as a basis * for new translations. * - * $Id: english.php,v 1.108 2003/10/03 07:38:55 chriskl Exp $ + * $Id: english.php,v 1.109 2003/10/06 18:10:18 soranzo Exp $ */ // Language and character set @@ -186,6 +186,7 @@ $lang['struserupdatedbad'] = 'User update failed.'; $lang['strshowallusers'] = 'Show all users'; $lang['strcreateuser'] = 'Create user'; + $lang['struserneedsname'] = 'You must give a name for your user.'; $lang['strusercreated'] = 'User created.'; $lang['strusercreatedbad'] = 'Failed to create user.'; $lang['strconfdropuser'] = 'Are you sure you want to drop the user "%s"?'; diff --git a/lang/italian.php b/lang/italian.php index 61033649..a8918723 100644 --- a/lang/italian.php +++ b/lang/italian.php @@ -4,7 +4,7 @@ * Italian language file, based on the english language file for phpPgAdmin. * Nicola Soranzo [nsoranzo@tiscali.it] * - * $Id: italian.php,v 1.17 2003/09/30 09:56:38 soranzo Exp $ + * $Id: italian.php,v 1.18 2003/10/06 18:10:18 soranzo Exp $ */ // Language and character set - Lingua e set di caratteri @@ -86,7 +86,8 @@ $lang['stradmin'] = 'Amministratore'; $lang['strvacuum'] = 'Vacuum'; $lang['stranalyze'] = 'Analizza'; - $lang['strcluster'] = 'Cluster'; + $lang['strcluster'] = 'Clusterizza'; + $lang['strclustered'] = 'Clusterizzato?'; $lang['strreindex'] = 'Reindicizza'; $lang['strrun'] = 'Esegui'; $lang['stradd'] = 'Aggiungi'; @@ -184,6 +185,7 @@ $lang['struserupdatedbad'] = 'Aggiornamento utente fallito.'; $lang['strshowallusers'] = 'Mostra tutti gli utenti'; $lang['strcreateuser'] = 'Crea utente'; + $lang['struserneedsname'] = 'È necessario specificare un nome per l\'utente.'; $lang['strusercreated'] = 'Utente creato.'; $lang['strusercreatedbad'] = 'Creazione dell\'utente fallita.'; $lang['strconfdropuser'] = 'Sei sicuro di voler eliminare l\'utente "%s"?'; @@ -226,7 +228,7 @@ $lang['strrevoke'] = 'Revoca'; $lang['strgranted'] = 'Privilegi concessi.'; $lang['strgrantfailed'] = 'Concessione dei privilegi fallita.'; - $lang['strgrantbad'] = 'Devi specificare almeno un utente o gruppo e almeno un privilegio.'; + $lang['strgrantbad'] = 'È necessario specificare almeno un utente o gruppo ed almeno un privilegio.'; $lang['stralterprivs'] = 'Modifica Privilegi'; $lang['strgrantor'] = 'Grantor'; // ??? $lang['strasterisk'] = '*'; @@ -317,6 +319,9 @@ $lang['strindextype'] = 'Tipo di indice'; $lang['strtablecolumnlist'] = 'Colonne nella tabella'; $lang['strindexcolumnlist'] = 'Colonne nell\'indice'; + $lang['strconfcluster'] = 'Sei sicuro di voler clusterizzare "%s"?'; + $lang['strclusteredgood'] = 'Clusterizzazione completata.'; + $lang['strclusteredbad'] = 'Clusterizzazione fallita.'; // Rules - Regole $lang['strrules'] = 'Regole'; diff --git a/lang/recoded/english.php b/lang/recoded/english.php index 57234f99..3237487e 100644 --- a/lang/recoded/english.php +++ b/lang/recoded/english.php @@ -4,7 +4,7 @@ * English language file for phpPgAdmin. Use this as a basis * for new translations. * - * $Id: english.php,v 1.60 2003/10/03 07:38:55 chriskl Exp $ + * $Id: english.php,v 1.61 2003/10/06 18:10:18 soranzo Exp $ */ // Language and character set @@ -186,6 +186,7 @@ $lang['struserupdatedbad'] = 'User update failed.'; $lang['strshowallusers'] = 'Show all users'; $lang['strcreateuser'] = 'Create user'; + $lang['struserneedsname'] = 'You must give a name for your user.'; $lang['strusercreated'] = 'User created.'; $lang['strusercreatedbad'] = 'Failed to create user.'; $lang['strconfdropuser'] = 'Are you sure you want to drop the user "%s"?'; diff --git a/lang/recoded/italian.php b/lang/recoded/italian.php index 780b5268..e1ef6cfc 100644 --- a/lang/recoded/italian.php +++ b/lang/recoded/italian.php @@ -4,7 +4,7 @@ * Italian language file, based on the english language file for phpPgAdmin. * Nicola Soranzo [nsoranzo@tiscali.it] * - * $Id: italian.php,v 1.12 2003/09/30 09:56:39 soranzo Exp $ + * $Id: italian.php,v 1.13 2003/10/06 18:10:20 soranzo Exp $ */ // Language and character set - Lingua e set di caratteri @@ -86,7 +86,8 @@ $lang['stradmin'] = 'Amministratore'; $lang['strvacuum'] = 'Vacuum'; $lang['stranalyze'] = 'Analizza'; - $lang['strcluster'] = 'Cluster'; + $lang['strcluster'] = 'Clusterizza'; + $lang['strclustered'] = 'Clusterizzato?'; $lang['strreindex'] = 'Reindicizza'; $lang['strrun'] = 'Esegui'; $lang['stradd'] = 'Aggiungi'; @@ -184,6 +185,7 @@ $lang['struserupdatedbad'] = 'Aggiornamento utente fallito.'; $lang['strshowallusers'] = 'Mostra tutti gli utenti'; $lang['strcreateuser'] = 'Crea utente'; + $lang['struserneedsname'] = 'È necessario specificare un nome per l\'utente.'; $lang['strusercreated'] = 'Utente creato.'; $lang['strusercreatedbad'] = 'Creazione dell\'utente fallita.'; $lang['strconfdropuser'] = 'Sei sicuro di voler eliminare l\'utente "%s"?'; @@ -226,7 +228,7 @@ $lang['strrevoke'] = 'Revoca'; $lang['strgranted'] = 'Privilegi concessi.'; $lang['strgrantfailed'] = 'Concessione dei privilegi fallita.'; - $lang['strgrantbad'] = 'Devi specificare almeno un utente o gruppo e almeno un privilegio.'; + $lang['strgrantbad'] = 'È necessario specificare almeno un utente o gruppo ed almeno un privilegio.'; $lang['stralterprivs'] = 'Modifica Privilegi'; $lang['strgrantor'] = 'Grantor'; // ??? $lang['strasterisk'] = '*'; @@ -317,6 +319,9 @@ $lang['strindextype'] = 'Tipo di indice'; $lang['strtablecolumnlist'] = 'Colonne nella tabella'; $lang['strindexcolumnlist'] = 'Colonne nell\'indice'; + $lang['strconfcluster'] = 'Sei sicuro di voler clusterizzare "%s"?'; + $lang['strclusteredgood'] = 'Clusterizzazione completata.'; + $lang['strclusteredbad'] = 'Clusterizzazione fallita.'; // Rules - Regole $lang['strrules'] = 'Regole'; diff --git a/users.php b/users.php index a03dc280..65883abe 100644 --- a/users.php +++ b/users.php @@ -3,7 +3,7 @@ /** * Manage users in a database cluster * - * $Id: users.php,v 1.17 2003/08/08 05:58:47 chriskl Exp $ + * $Id: users.php,v 1.18 2003/10/06 18:10:14 soranzo Exp $ */ // Include application functions @@ -60,12 +60,13 @@ echo "
\n"; - echo $lang['strpassword'], "
\n"; - echo "

\n"; - echo $lang['strconfirm'], "
\n"; - echo "

\n"; + echo "\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "
{$lang['strpassword']}
{$lang['strconfirm']}
\n"; echo "\n"; echo "\n"; echo "\n"; @@ -111,19 +112,20 @@ echo "\n"; echo "
\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
{$lang['strusername']}{$lang['strsuper']}{$lang['strcreatedb']}{$lang['strexpires']}
", $misc->printVal($userdata->f[$data->uFields['uname']]), "f[$data->uFields['usuper']]) ? ' checked="checked"' : '', " />f[$data->uFields['ucreatedb']]) ? ' checked="checked"' : '', " />

\n"; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; echo "
{$lang['strpassword']}{$lang['strconfirm']}
{$lang['strusername']}", $misc->printVal($userdata->f[$data->uFields['uname']]), "
{$lang['strsuper']}f[$data->uFields['usuper']]) ? ' checked="checked"' : '', " />
{$lang['strcreatedb']}f[$data->uFields['ucreatedb']]) ? ' checked="checked"' : '', " />
{$lang['strexpires']}
{$lang['strpassword']}
{$lang['strconfirm']}
\n"; echo "

\n"; echo "\n"; @@ -146,42 +148,12 @@ else { $status = $data->setUser($_POST['username'], $_POST['formPassword'], isset($_POST['formCreateDB']), isset($_POST['formSuper']), $_POST['formExpires']); if ($status == 0) - doProperties($lang['struserupdated']); + doDefault($lang['struserupdated']); else doEdit($lang['struserupdatedbad']); } } - - /** - * Show read only properties for a user - */ - function doProperties($msg = '') { - global $data, $misc; - global $PHP_SELF, $lang; - - echo "

{$lang['strusers']}: ", $misc->printVal($_REQUEST['username']), ": {$lang['strproperties']}

\n"; - $misc->printMsg($msg); - - $userdata = &$data->getUser($_REQUEST['username']); - - if ($userdata->recordCount() > 0) { - $userdata->f[$data->uFields['usuper']] = $data->phpBool($userdata->f[$data->uFields['usuper']]); - $userdata->f[$data->uFields['ucreatedb']] = $data->phpBool($userdata->f[$data->uFields['ucreatedb']]); - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
{$lang['strusername']}{$lang['strsuper']}{$lang['strcreatedb']}{$lang['strexpires']}
", $misc->printVal($userdata->f[$data->uFields['uname']]), "", (($userdata->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno']), "", (($userdata->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno']), "", $misc->printVal($userdata->f[$data->uFields['uexpires']]), "
\n"; - } - else echo "

{$lang['strnodata']}

\n"; - - echo "

{$lang['strshowallusers']} |\n"; - echo "{$lang['stralter']}

\n"; - } - + /** * Show confirmation of drop and perform actual drop */ @@ -227,17 +199,20 @@ echo "\n"; echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; + echo "\t\n\t\t\n"; + echo "\t\t\n\t\n"; echo "
{$lang['strusername']}{$lang['strpassword']}{$lang['strconfirm']}{$lang['strsuper']}{$lang['strcreatedb']}{$lang['strexpires']}
{$lang['strusername']}
{$lang['strpassword']}
{$lang['strconfirm']}
{$lang['strsuper']}
{$lang['strcreatedb']}
{$lang['strexpires']}
\n"; echo "

\n"; echo "\n"; @@ -253,7 +228,9 @@ global $lang; // Check data - if ($_POST['formPassword'] != $_POST['formConfirm']) + if ($_POST['formUsername'] == '') + doCreate($lang['struserneedsname']); + else if ($_POST['formPassword'] != $_POST['formConfirm']) doCreate($lang['strpasswordconfirm']); else { $status = $data->createUser($_POST['formUsername'], $_POST['formPassword'], @@ -290,8 +267,8 @@ echo "", ($users->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno'], "\n"; echo "", ($users->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno'], "\n"; echo "", $misc->printVal($users->f[$data->uFields['uexpires']]), "\n"; - echo "f[$data->uFields['uname']]), "\">{$lang['strproperties']}\n"; + echo "f[$data->uFields['uname']]), "\">{$lang['stralter']}\n"; echo "f[$data->uFields['uname']]), "\">{$lang['strdrop']}\n"; echo "\n"; @@ -337,15 +314,12 @@ doDrop(true); break; case 'save_edit': - if (isset($_REQUEST['cancel'])) doProperties(); + if (isset($_REQUEST['cancel'])) doDefault(); else doSaveEdit(); break; case 'edit': doEdit(); break; - case 'properties': - doProperties(); - break; default: doDefault(); break; -- 2.39.5