Servers choice box was displayed even if there is only one server

This commit is contained in:
Loïc Chapeaux
2001-12-24 11:16:21 +00:00
parent e4b9fb85f1
commit 5432997e42
2 changed files with 57 additions and 39 deletions

View File

@@ -5,10 +5,14 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2001-12-24 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/auth/cookie.auth.lib.php3: servers choice box was displayed
even if there is only one server.
2001-12-23 Marc Delisle <lem9@users.sourceforge.net> 2001-12-23 Marc Delisle <lem9@users.sourceforge.net>
* links to new short doc pages are now completed * links to new short doc pages are now completed
* updates to lang/italian.inc.php3, thanks to Pietro Danesi * updates to lang/italian.inc.php3, thanks to Pietro Danesi
* user_details.php3: missing message "Remember reload..." * user_details.php3: missing message "Remember reload..."
2001-12-23 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-12-23 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* tbl_select.php3, lines 202-206: fixed bug #472728 - Many fields / IE 5.5 * tbl_select.php3, lines 202-206: fixed bug #472728 - Many fields / IE 5.5

View File

@@ -144,52 +144,66 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
<input type="password" name="pma_password" value="" size="24" onfocus="this.select()" /> <input type="password" name="pma_password" value="" size="24" onfocus="this.select()" />
</td> </td>
</tr> </tr>
<?php
if (count($cfgServers) > 1) {
echo "\n";
?>
<tr> <tr>
<td align="<?php echo $cell_align; ?>"><?php echo $GLOBALS['strServerChoice']; ?>&nbsp;:&nbsp;</td> <td align="<?php echo $cell_align; ?>"><?php echo $GLOBALS['strServerChoice']; ?>&nbsp;:&nbsp;</td>
<td align="<?php echo $cell_align; ?>"> <td align="<?php echo $cell_align; ?>">
<select name="server"> <select name="server">
<?php <?php
echo "\n"; echo "\n";
// Displays the MySQL servers choice // Displays the MySQL servers choice
reset($cfgServers); reset($cfgServers);
while (list($key, $val) = each($cfgServers)) { while (list($key, $val) = each($cfgServers)) {
if (!empty($val['host'])) { if (!empty($val['host'])) {
echo ' <option value="' . $key . '"'; echo ' <option value="' . $key . '"';
if (!empty($server) && ($server == $key)) { if (!empty($server) && ($server == $key)) {
echo ' selected="selected"'; echo ' selected="selected"';
}
echo '>';
if ($val['verbose'] != '') {
echo $val['verbose'];
} else {
echo $val['host'];
if (!empty($val['port'])) {
echo ':' . $val['port'];
} }
// loic1: skip this because it's not a so good idea to echo '>';
// display sockets used to everybody if ($val['verbose'] != '') {
// if (!empty($val['socket']) && PMA_PHP_INT_VERSION >= 30010) { echo $val['verbose'];
// echo ':' . $val['socket']; } else {
// } echo $val['host'];
} if (!empty($val['port'])) {
// loic1: if 'only_db' is an array and there is more than one echo ':' . $val['port'];
// value, displaying such informations may not be a so }
// good idea // loic1: skip this because it's not a so good idea to
if (!empty($val['only_db'])) { // display sockets used to everybody
echo ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']); // if (!empty($val['socket']) && PMA_PHP_INT_VERSION >= 30010) {
} // echo ':' . $val['socket'];
if (!empty($val['user']) && ($val['auth_type'] == 'basic')) { // }
echo ' (' . $val['user'] . ')'; }
} // loic1: if 'only_db' is an array and there is more than one
echo '&nbsp;</option>' . "\n"; // value, displaying such informations may not be a so
} // end if (!empty($val['host'])) // good idea
} // end while if (!empty($val['only_db'])) {
?> echo ' - ' . (is_array($val['only_db']) ? implode(', ', $val['only_db']) : $val['only_db']);
}
if (!empty($val['user']) && ($val['auth_type'] == 'basic')) {
echo ' (' . $val['user'] . ')';
}
echo '&nbsp;</option>' . "\n";
} // end if (!empty($val['host']))
} // end while
?>
</select> </select>
</td> </td>
</tr> </tr>
<?php
} // end if (server choice)
echo "\n";
?>
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
<?php
if (count($cfgServers) == 1) {
echo ' <input type="hidden" name="server" value="' . $server . '" />';
}
echo "\n";
?>
<input type="hidden" name="lang" value="<?php echo $lang; ?>" /> <input type="hidden" name="lang" value="<?php echo $lang; ?>" />
<input type="submit" value="<?php echo $GLOBALS['strLogin']; ?>" /> <input type="submit" value="<?php echo $GLOBALS['strLogin']; ?>" />
</td> </td>