Third part of required+left style fixes: users.php. Also dropped doProperties() ...
authorsoranzo <soranzo>
Mon, 6 Oct 2003 18:10:14 +0000 (18:10 +0000)
committersoranzo <soranzo>
Mon, 6 Oct 2003 18:10:14 +0000 (18:10 +0000)
lang/english.php
lang/italian.php
lang/recoded/english.php
lang/recoded/italian.php
users.php

index 7492b470f6f1f2d588396e14144f4bb1255f7a89..b443d746c0ca238d36e46e9732241aca57faecec 100755 (executable)
@@ -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
        $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"?';
index 61033649e007f8a3110c332e353402a2b5af8d62..a8918723a102b81a0b4eff27c9411a605fc948b7 100644 (file)
@@ -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';
        $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"?';
        $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'] = '*';
        $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';
index 57234f99f8be0aab163cc800359981daf30e2938..3237487ef0d4804a17a870745e8daff5fb4b21a7 100644 (file)
@@ -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
        $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 &quot;%s&quot;?';
index 780b52687d1dbd63b5ee3d3e2870b894f2a30a6f..e1ef6cfc9d221c228848b50582fcfdb7782b32fa 100644 (file)
@@ -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';
        $lang['struserupdatedbad'] = 'Aggiornamento utente fallito.';
        $lang['strshowallusers'] = 'Mostra tutti gli utenti';
        $lang['strcreateuser'] = 'Crea utente';
+       $lang['struserneedsname'] = '&Egrave; 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 &quot;%s&quot;?';
        $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'] = '&Egrave; necessario specificare almeno un utente o gruppo ed almeno un privilegio.';
        $lang['stralterprivs'] = 'Modifica Privilegi';
        $lang['strgrantor'] = 'Grantor'; // ???
        $lang['strasterisk'] = '*';
        $lang['strindextype'] = 'Tipo di indice';
        $lang['strtablecolumnlist'] = 'Colonne nella tabella';
        $lang['strindexcolumnlist'] = 'Colonne nell\'indice';
+       $lang['strconfcluster'] = 'Sei sicuro di voler clusterizzare &quot;%s&quot;?';
+       $lang['strclusteredgood'] = 'Clusterizzazione completata.';
+       $lang['strclusteredbad'] = 'Clusterizzazione fallita.';
 
         // Rules - Regole
        $lang['strrules'] = 'Regole';
index a03dc280423fba41844471059158b949d7cc3302..65883abe29cf76d7e96c9a3c066a6fa2ac3995b1 100644 (file)
--- 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
                        
                        
                        echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
-                       echo $lang['strpassword'], "<br />\n";
-                       echo "<input type=\"password\" name=\"password\" size=\"32\" value=\"", 
-                               htmlspecialchars($_POST['password']), "\" /><br /><br />\n";
-                       echo $lang['strconfirm'], "<br />\n";
-                       echo "<input type=\"password\" name=\"confirm\" size=\"32\" value=\"", 
-                               htmlspecialchars($_POST['confirm']), "\" /><br /><br />\n";
+                       echo "<table>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strpassword']}</th>\n";
+                       echo "\t\t<td><input type=\"password\" name=\"password\" size=\"32\" value=\"", 
+                               htmlspecialchars($_POST['password']), "\" /></td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strconfirm']}</th>\n";
+                       echo "\t\t<td><input type=\"password\" name=\"confirm\" size=\"32\" value=\"\" /></td>\n\t</tr>\n";
+                       echo "<table>\n";
                        echo "<input type=\"hidden\" name=\"action\" value=\"changepassword\" />\n";
                        echo "<input type=\"submit\" name=\"ok\" value=\"{$lang['strok']}\" />\n";
                        echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" />\n";
                
                        echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                        echo "<table>\n";
-                       echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th>";
-                       echo "<th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th></tr>\n";
-                       echo "<tr><td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uname']]), "</td>\n";
-                       echo "<td class=\"data1\"><input type=\"checkbox\" name=\"formSuper\"", 
-                               ($userdata->f[$data->uFields['usuper']]) ? ' checked="checked"' : '', " /></td>\n";
-                       echo "<td class=\"data1\"><input type=\"checkbox\" name=\"formCreateDB\"", 
-                               ($userdata->f[$data->uFields['ucreatedb']]) ? ' checked="checked"' : '', " /></td>\n";
-                       echo "<td class=\"data1\"><input size=\"22\" name=\"formExpires\" value=\"", htmlspecialchars($_POST['formExpires']), "\" /></td></tr>\n";
-                       echo "</table><br />\n";
-                       echo "<table>\n";
-                       echo "<tr><th class=\"data\">{$lang['strpassword']}</th><th class=\"data\">{$lang['strconfirm']}</th></tr>";
-                       echo "<td class=\"data1\"><input size=\"16\" name=\"formPassword\" value=\"", htmlspecialchars($_POST['formPassword']), "\" /></td>\n";
-                       echo "<td class=\"data1\"><input size=\"16\" name=\"formConfirm\" value=\"", htmlspecialchars($_POST['formConfirm']), "\" /></td></tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strusername']}</th>\n";
+                       echo "\t\t<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uname']]), "</td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strsuper']}</th>\n";
+                       echo "\t\t<td class=\"data1\"><input type=\"checkbox\" name=\"formSuper\"", 
+                               ($userdata->f[$data->uFields['usuper']]) ? ' checked="checked"' : '', " /></td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strcreatedb']}</th>\n";
+                       echo "\t\t<td class=\"data1\"><input type=\"checkbox\" name=\"formCreateDB\"", 
+                               ($userdata->f[$data->uFields['ucreatedb']]) ? ' checked="checked"' : '', " /></td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strexpires']}</th>\n";
+                       echo "\t\t<td class=\"data1\"><input size=\"16\" name=\"formExpires\" value=\"", htmlspecialchars($_POST['formExpires']), "\" /></td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strpassword']}</th>\n";
+                       echo "\t\t<td class=\"data1\"><input type=\"password\" size=\"16\" name=\"formPassword\" value=\"", htmlspecialchars($_POST['formPassword']), "\" /></td>\n\t</tr>\n";
+                       echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strconfirm']}</th>\n";
+                       echo "\t\t<td class=\"data1\"><input type=\"password\" size=\"16\" name=\"formConfirm\" value=\"\" /></td>\n\t</tr>\n";
                        echo "</table>\n";
                        echo "<p><input type=\"hidden\" name=\"action\" value=\"save_edit\" />\n";
                        echo "<input type=\"hidden\" name=\"username\" value=\"", htmlspecialchars($_REQUEST['username']), "\" />\n";
                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 "<h2>{$lang['strusers']}: ", $misc->printVal($_REQUEST['username']), ": {$lang['strproperties']}</h2>\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 "<table>\n";
-                       echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th><th class=\"data\">{$lang['strexpires']}</th></tr>\n";
-                       echo "<tr><td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uname']]), "</td>\n";
-                       echo "<td class=\"data1\">", (($userdata->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
-                       echo "<td class=\"data1\">", (($userdata->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno']), "</td>\n";
-                       echo "<td class=\"data1\">", $misc->printVal($userdata->f[$data->uFields['uexpires']]), "</td></tr>\n";
-                       echo "</table>\n";
-               }
-               else echo "<p>{$lang['strnodata']}</p>\n";
-               
-               echo "<p><a class=\"navlink\" href=\"$PHP_SELF\">{$lang['strshowallusers']}</a> |\n";
-               echo "<a class=\"navlink\" href=\"$PHP_SELF?action=edit&amp;username=", 
-                       urlencode($_REQUEST['username']), "\">{$lang['stralter']}</a></p>\n";
-       }
-       
+
        /**
         * Show confirmation of drop and perform actual drop
         */
 
                echo "<form action=\"$PHP_SELF\" method=\"post\">\n";
                echo "<table>\n";
-               echo "<tr><th class=\"data\">{$lang['strusername']}</th><th class=\"data\">{$lang['strpassword']}</th><th class=\"data\">{$lang['strconfirm']}</th>";
-               echo "<th class=\"data\">{$lang['strsuper']}</th><th class=\"data\">{$lang['strcreatedb']}</th>";
-               echo "<th class=\"data\">{$lang['strexpires']}</th></tr>\n";
-               echo "<tr><td class=\"data1\"><input size=\"15\" name=\"formUsername\" value=\"", htmlspecialchars($_POST['formUsername']), "\" /></td>\n";
-               echo "<td class=\"data1\"><input size=\"15\" type=\"password\" name=\"formPassword\" value=\"", htmlspecialchars($_POST['formPassword']), "\" /></td>\n";
-               echo "<td class=\"data1\"><input size=\"15\" type=\"password\" name=\"formConfirm\" value=\"", htmlspecialchars($_POST['formConfirm']), "\" /></td>\n";
-               echo "<td class=\"data1\"><input type=\"checkbox\" name=\"formSuper\"", 
-                       (isset($_POST['formSuper'])) ? ' checked="checked"' : '', " /></td>\n";
-               echo "<td class=\"data1\"><input type=\"checkbox\" name=\"formCreateDB\"", 
-                       (isset($_POST['formCreateDB'])) ? ' checked="checked"' : '', " /></td>\n";
-               echo "<td class=\"data1\"><input size=\"30\" name=\"formExpires\" value=\"", htmlspecialchars($_POST['formExpires']), "\" /></td></tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strusername']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input size=\"15\" name=\"formUsername\" value=\"", htmlspecialchars($_POST['formUsername']), "\" /></td>\n\t</tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strpassword']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input size=\"15\" type=\"password\" name=\"formPassword\" value=\"", htmlspecialchars($_POST['formPassword']), "\" /></td>\n\t</tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strconfirm']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input size=\"15\" type=\"password\" name=\"formConfirm\" value=\"", htmlspecialchars($_POST['formConfirm']), "\" /></td>\n\t</tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strsuper']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input type=\"checkbox\" name=\"formSuper\"", 
+                       (isset($_POST['formSuper'])) ? ' checked="checked"' : '', " /></td>\n\t</tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strcreatedb']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input type=\"checkbox\" name=\"formCreateDB\"", 
+                       (isset($_POST['formCreateDB'])) ? ' checked="checked"' : '', " /></td>\n\t</tr>\n";
+               echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strexpires']}</th>\n";
+               echo "\t\t<td class=\"data1\"><input size=\"30\" name=\"formExpires\" value=\"", htmlspecialchars($_POST['formExpires']), "\" /></td>\n\t</tr>\n";
                echo "</table>\n";
                echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create\" />\n";
                echo "<input type=\"submit\" value=\"{$lang['strcreate']}\" />\n";
                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'], 
                                echo "<td class=\"data{$id}\">", ($users->f[$data->uFields['usuper']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
                                echo "<td class=\"data{$id}\">", ($users->f[$data->uFields['ucreatedb']]) ? $lang['stryes'] : $lang['strno'], "</td>\n";
                                echo "<td class=\"data{$id}\">", $misc->printVal($users->f[$data->uFields['uexpires']]), "</td>\n";
-                               echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=properties&amp;username=",
-                                       urlencode($users->f[$data->uFields['uname']]), "\">{$lang['strproperties']}</a></td>\n";
+                               echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=edit&amp;username=",
+                                       urlencode($users->f[$data->uFields['uname']]), "\">{$lang['stralter']}</a></td>\n";
                                echo "<td class=\"opbutton{$id}\"><a href=\"$PHP_SELF?action=confirm_drop&amp;username=", 
                                        urlencode($users->f[$data->uFields['uname']]), "\">{$lang['strdrop']}</a></td>\n";
                                echo "</tr>\n";
                        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;