diff --git a/ChangeLog b/ChangeLog index 53038878e..75109bb18 100755 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ $Source$ 2006-01-11 Michal Čihař * main.php: Do not fail if no server is defined. + * main.php, libraries/left_header.inc.php, + libraries/select_server.lib.php: Show server selection if no server set + and we have one server configuration (bug #1399880). 2006-01-10 Marc Delisle * libraries/sqlparser.lib.php: bug #1394479, problem detecting ending diff --git a/libraries/left_header.inc.php b/libraries/left_header.inc.php index 0b361fa7b..03e3a2cb2 100644 --- a/libraries/left_header.inc.php +++ b/libraries/left_header.inc.php @@ -83,7 +83,7 @@ echo '' . "\n"; /** * Displays the MySQL servers choice form */ -if ( $GLOBALS['cfg']['LeftDisplayServers'] && count($cfg['Servers']) > 1 ) { +if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) { include('./libraries/select_server.lib.php'); PMA_select_server(TRUE, TRUE); } // end if LeftDisplayServers diff --git a/libraries/select_server.lib.php b/libraries/select_server.lib.php index 512517066..0de2d765c 100644 --- a/libraries/select_server.lib.php +++ b/libraries/select_server.lib.php @@ -72,9 +72,18 @@ function PMA_select_server($form, $left) { - '; + } + ?> 0 ) { if ($cfg['Server']['auth_type'] == 'config') { $cfg['ShowChgPassword'] = FALSE; } - +} ?>
0 ) { // robbat2: Use the verbose name of the server instead of the hostname // if a value is set $server_info = ''; @@ -73,15 +74,20 @@ if ( $server > 0 ) { echo '

MySQL - ' . PMA_MYSQL_STR_VERSION .'

' . "\n"; +} else { + // Case when no server selected + echo '

MySQL

' . "\n"; +} - /** - * Displays the MySQL servers choice form - */ - if (!$cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1) { - include('./libraries/select_server.lib.php'); - PMA_select_server(TRUE, FALSE); - } +/** + * Displays the MySQL servers choice form + */ +if (!$cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)) { + include('./libraries/select_server.lib.php'); + PMA_select_server(TRUE, FALSE); +} +if ( $server > 0 ) { echo '
    ' . "\n"; PMA_printListItem( $strProtocolVersion . ': ' . PMA_DBI_get_proto_info()