Handle correctly situation with no default server (bug #1049107).
This commit is contained in:
@@ -11,6 +11,8 @@ $Source$
|
|||||||
* sql.php: Fix undefined index.
|
* sql.php: Fix undefined index.
|
||||||
* libraries/sqlparser.lib.php: Return raw query in case of error (bug
|
* libraries/sqlparser.lib.php: Return raw query in case of error (bug
|
||||||
#1048826).
|
#1048826).
|
||||||
|
* main.php, queryframe.php: Handle correctly situation with no default
|
||||||
|
server (bug #1049107).
|
||||||
|
|
||||||
2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
|
2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* lang/turkish update, thanks to boralioglu.
|
* lang/turkish update, thanks to boralioglu.
|
||||||
|
44
main.php
44
main.php
@@ -81,7 +81,7 @@ echo "\n";
|
|||||||
<td valign="top">
|
<td valign="top">
|
||||||
<h1>
|
<h1>
|
||||||
<?php
|
<?php
|
||||||
echo sprintf($strWelcome, ' phpMyAdmin ' . PMA_VERSION . '');
|
echo sprintf($strWelcome, ' phpMyAdmin ' . PMA_VERSION . '');
|
||||||
?>
|
?>
|
||||||
</h1>
|
</h1>
|
||||||
<?php
|
<?php
|
||||||
@@ -290,7 +290,7 @@ if ($server > 0) {
|
|||||||
<th class="tblHeaders"<?php echo $str_iconic_colspan; ?>> MySQL</th>
|
<th class="tblHeaders"<?php echo $str_iconic_colspan; ?>> MySQL</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','b_newdb.png',$strCreateNewDatabase,'') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','b_newdb.png',$strCreateNewDatabase,'') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<!-- db creation form -->
|
<!-- db creation form -->
|
||||||
<td valign="top" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
|
<td valign="top" align="<?php echo $cell_align_left; ?>" nowrap="nowrap">
|
||||||
@@ -316,8 +316,8 @@ if ($server > 0) {
|
|||||||
?>
|
?>
|
||||||
<!-- db creation no privileges message -->
|
<!-- db creation no privileges message -->
|
||||||
<b><?php echo $strCreateNewDatabase . ': ' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE'); ?></b><br />
|
<b><?php echo $strCreateNewDatabase . ': ' . PMA_showMySQLDocu('Reference', 'CREATE_DATABASE'); ?></b><br />
|
||||||
<?php
|
<?php
|
||||||
echo '<span class="noPrivileges">'
|
echo '<span class="noPrivileges">'
|
||||||
. ($cfg['ErrorIconic'] ? '<img src="' . $pmaThemeImage . 's_error2.png" width="11" height="11" hspace="2" border="0" align="middle" />' : '')
|
. ($cfg['ErrorIconic'] ? '<img src="' . $pmaThemeImage . 's_error2.png" width="11" height="11" hspace="2" border="0" align="middle" />' : '')
|
||||||
. '' . $strNoPrivileges .'</span>';
|
. '' . $strNoPrivileges .'</span>';
|
||||||
} // end create db form or message
|
} // end create db form or message
|
||||||
@@ -371,7 +371,7 @@ if ($server > 0) {
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="./server_collations.php?'.$common_url_query.'">','s_asci.png',$strCharsetsAndCollations,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="./server_collations.php?'.$common_url_query.'">','s_asci.png',$strCharsetsAndCollations,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<a href="./server_collations.php?<?php echo $common_url_query; ?>">
|
<a href="./server_collations.php?<?php echo $common_url_query; ?>">
|
||||||
@@ -385,7 +385,7 @@ if ($server > 0) {
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list!='' ? sprintf($str_iconic_list,'<a href="main.php?'.$common_url_query.'&mode=reload">','s_reload.png',$strReloadMySQL,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list!='' ? sprintf($str_iconic_list,'<a href="main.php?'.$common_url_query.'&mode=reload">','s_reload.png',$strReloadMySQL,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<a href="main.php?<?php echo $common_url_query; ?>&mode=reload">
|
<a href="main.php?<?php echo $common_url_query; ?>&mode=reload">
|
||||||
@@ -400,7 +400,7 @@ if ($server > 0) {
|
|||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="server_privileges.php?'.$common_url_query.'">','s_rights.png',$strPrivileges,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="server_privileges.php?'.$common_url_query.'">','s_rights.png',$strPrivileges,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<a href="server_privileges.php?<?php echo $common_url_query; ?>">
|
<a href="server_privileges.php?<?php echo $common_url_query; ?>">
|
||||||
@@ -411,7 +411,7 @@ if ($server > 0) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="server_databases.php?'.$common_url_query.'">','s_db.png',$strDatabases,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="server_databases.php?'.$common_url_query.'">','s_db.png',$strDatabases,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<a href="./server_databases.php?<?php echo $common_url_query; ?>">
|
<a href="./server_databases.php?<?php echo $common_url_query; ?>">
|
||||||
@@ -448,7 +448,7 @@ if ($server > 0) {
|
|||||||
// Logout for advanced authentication
|
// Logout for advanced authentication
|
||||||
if ($cfg['Server']['auth_type'] != 'config') {
|
if ($cfg['Server']['auth_type'] != 'config') {
|
||||||
$http_logout = ($cfg['Server']['auth_type'] == 'http')
|
$http_logout = ($cfg['Server']['auth_type'] == 'http')
|
||||||
? "\n"
|
? "\n"
|
||||||
. ' <a href="./Documentation.html#login_bug" target="documentation">'
|
. ' <a href="./Documentation.html#login_bug" target="documentation">'
|
||||||
. ($cfg['ReplaceHelpImg'] ? '<img src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" border="0" alt="Info" align="middle" />' : '(*)') . '</a>'
|
. ($cfg['ReplaceHelpImg'] ? '<img src="' . $pmaThemeImage . 'b_info.png" width="11" height="11" border="0" alt="Info" align="middle" />' : '(*)') . '</a>'
|
||||||
: '';
|
: '';
|
||||||
@@ -487,7 +487,7 @@ if (empty($cfg['Lang'])) {
|
|||||||
?>
|
?>
|
||||||
<!-- Language Selection -->
|
<!-- Language Selection -->
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list !='' ? sprintf($str_iconic_list,'<a href="./translators.html" target="documentation">','s_lang.png','Language','</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list !='' ? sprintf($str_iconic_list,'<a href="./translators.html" target="documentation">','s_lang.png','Language','</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
<form method="post" action="index.php" target="_parent">
|
<form method="post" action="index.php" target="_parent">
|
||||||
@@ -533,12 +533,12 @@ if (empty($cfg['Lang'])) {
|
|||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
||||||
&& $allow_recoding && PMA_MYSQL_INT_VERSION < 40100) {
|
&& $server != 0 && $allow_recoding && PMA_MYSQL_INT_VERSION < 40100) {
|
||||||
echo "\n";
|
echo "\n";
|
||||||
?>
|
?>
|
||||||
<!-- Charset Selection -->
|
<!-- Charset Selection -->
|
||||||
@@ -569,10 +569,10 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
} elseif (PMA_MYSQL_INT_VERSION >= 40100) {
|
} elseif ($server != 0 && PMA_MYSQL_INT_VERSION >= 40100) {
|
||||||
echo ' <!-- Charset Info -->' . "\n"
|
echo ' <!-- Charset Info -->' . "\n"
|
||||||
. ' <tr>' . "\n"
|
. ' <tr>' . "\n"
|
||||||
.' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','s_asci.png',$strMySQLCharset,'') : $str_normal_list) . "\n"
|
.' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','s_asci.png',$strMySQLCharset,'') : $str_normal_list) . "\n"
|
||||||
. ' <td>' . "\n"
|
. ' <td>' . "\n"
|
||||||
. ' ' . $strMySQLCharset . ': '
|
. ' ' . $strMySQLCharset . ': '
|
||||||
. ' <b>'
|
. ' <b>'
|
||||||
@@ -583,7 +583,7 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
|
|||||||
. ' </tr>' . "\n"
|
. ' </tr>' . "\n"
|
||||||
. ' <!-- MySQL Connection Collation -->' . "\n"
|
. ' <!-- MySQL Connection Collation -->' . "\n"
|
||||||
. ' <tr>' . "\n"
|
. ' <tr>' . "\n"
|
||||||
.' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','s_asci.png',$strMySQLCharset,'') : $str_normal_list) . "\n"
|
.' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','s_asci.png',$strMySQLCharset,'') : $str_normal_list) . "\n"
|
||||||
. ' <td>' . "\n"
|
. ' <td>' . "\n"
|
||||||
. ' <form method="post" action="index.php" target="_parent">' . "\n"
|
. ' <form method="post" action="index.php" target="_parent">' . "\n"
|
||||||
. PMA_generate_common_hidden_inputs(NULL, NULL, 4, 'collation_connection')
|
. PMA_generate_common_hidden_inputs(NULL, NULL, 4, 'collation_connection')
|
||||||
@@ -617,12 +617,12 @@ if (isset($available_themes_choices) && $available_themes_choices > 1) {
|
|||||||
?>
|
?>
|
||||||
<td>
|
<td>
|
||||||
<form name="setTheme" method="post" action="index.php" target="_parent">
|
<form name="setTheme" method="post" action="index.php" target="_parent">
|
||||||
<?php
|
<?php
|
||||||
echo PMA_generate_common_hidden_inputs('', '', 5);
|
echo PMA_generate_common_hidden_inputs('', '', 5);
|
||||||
echo $theme_preview_href
|
echo $theme_preview_href
|
||||||
. (isset($strTheme) ? $strTheme : 'Theme (Style)')
|
. (isset($strTheme) ? $strTheme : 'Theme (Style)')
|
||||||
. '</a>:' . "\n";
|
. '</a>:' . "\n";
|
||||||
?>
|
?>
|
||||||
<select name="set_theme" dir="ltr" onchange="this.form.submit();" style="vertical-align: middle">
|
<select name="set_theme" dir="ltr" onchange="this.form.submit();" style="vertical-align: middle">
|
||||||
<?php
|
<?php
|
||||||
foreach ($available_themes_choices AS $cur_theme) {
|
foreach ($available_themes_choices AS $cur_theme) {
|
||||||
@@ -643,7 +643,7 @@ if (isset($available_themes_choices) && $available_themes_choices > 1) {
|
|||||||
?>
|
?>
|
||||||
<!-- Documentation -->
|
<!-- Documentation -->
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="Documentation.html" target="documentation">','b_docs.png',$strPmaDocumentation,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="Documentation.html" target="documentation">','b_docs.png',$strPmaDocumentation,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
<a href="Documentation.html" target="documentation"><b><?php echo $strPmaDocumentation; ?></b></a>
|
<a href="Documentation.html" target="documentation"><b><?php echo $strPmaDocumentation; ?></b></a>
|
||||||
@@ -655,7 +655,7 @@ if ($is_superuser || $cfg['ShowPhpInfo']) {
|
|||||||
?>
|
?>
|
||||||
<!-- PHP Information -->
|
<!-- PHP Information -->
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="phpinfo.php?' . PMA_generate_common_url() . '" target="_blank">','php_sym.png',$strShowPHPInfo,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="phpinfo.php?' . PMA_generate_common_url() . '" target="_blank">','php_sym.png',$strShowPHPInfo,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
<a href="phpinfo.php?<?php echo PMA_generate_common_url(); ?>" target="_blank"><?php echo $strShowPHPInfo; ?></a>
|
<a href="phpinfo.php?<?php echo PMA_generate_common_url(); ?>" target="_blank"><?php echo $strShowPHPInfo; ?></a>
|
||||||
@@ -668,15 +668,15 @@ echo "\n";
|
|||||||
|
|
||||||
<!-- phpMyAdmin related urls -->
|
<!-- phpMyAdmin related urls -->
|
||||||
<tr><?php
|
<tr><?php
|
||||||
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="http://www.phpMyAdmin.net/" target="_blank">','b_home.png',$strHomepageOfficial,'</a>') : $str_normal_list);
|
echo ' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'<a href="http://www.phpMyAdmin.net/" target="_blank">','b_home.png',$strHomepageOfficial,'</a>') : $str_normal_list);
|
||||||
?>
|
?>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
<a href="http://www.phpMyAdmin.net/" target="_blank"><?php echo $strHomepageOfficial; ?></a>
|
<a href="http://www.phpMyAdmin.net/" target="_blank"><?php echo $strHomepageOfficial; ?></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<?php
|
<?php
|
||||||
echo '<td><img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" /></td>';
|
echo '<td><img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" /></td>';
|
||||||
?>
|
?>
|
||||||
<td nowrap="nowrap">
|
<td nowrap="nowrap">
|
||||||
[<a href="changelog.php" target="_blank">ChangeLog</a>]
|
[<a href="changelog.php" target="_blank">ChangeLog</a>]
|
||||||
|
@@ -183,34 +183,36 @@ if ($cfg['MainPageIconic']) {
|
|||||||
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
|
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
|
||||||
: '<b>' . $strHome . '</b>')
|
: '<b>' . $strHome . '</b>')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
// Logout for advanced authentication
|
// if we have chosen server
|
||||||
if ($cfg['Server']['auth_type'] != 'config') {
|
if ($server != 0) {
|
||||||
echo $str_spacer_links;
|
// Logout for advanced authentication
|
||||||
echo '<a class="item" href="index.php?' . PMA_generate_common_url() . '&old_usr=' . urlencode($PHP_AUTH_USER) . '" target="_parent">'
|
if ($cfg['Server']['auth_type'] != 'config') {
|
||||||
. ($cfg['MainPageIconic']
|
echo $str_spacer_links;
|
||||||
? '<img src="' . $pmaThemeImage . 's_loggoff.png" width="16" height="16" border="0" hspace="2" alt="' . $strLogout . '" title="' . $strLogout . '"'
|
echo '<a class="item" href="index.php?' . PMA_generate_common_url() . '&old_usr=' . urlencode($PHP_AUTH_USER) . '" target="_parent">'
|
||||||
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
|
. ($cfg['MainPageIconic']
|
||||||
: '<b>' . $strLogout . '</b>')
|
? '<img src="' . $pmaThemeImage . 's_loggoff.png" width="16" height="16" border="0" hspace="2" alt="' . $strLogout . '" title="' . $strLogout . '"'
|
||||||
. '</a>';
|
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
|
||||||
} // end if
|
: '<b>' . $strLogout . '</b>')
|
||||||
|
. '</a>';
|
||||||
|
} // end if
|
||||||
|
|
||||||
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
|
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
|
||||||
if ($cfg['QueryFrameJS']) {
|
if ($cfg['QueryFrameJS']) {
|
||||||
$href = $anchor;
|
$href = $anchor;
|
||||||
$target = '';
|
$target = '';
|
||||||
$onclick = 'onclick="javascript:open_querywindow(this.href); return false;"';
|
$onclick = 'onclick="javascript:open_querywindow(this.href); return false;"';
|
||||||
} else {
|
} else {
|
||||||
$href = $anchor;
|
$href = $anchor;
|
||||||
$target = 'target="phpmain' . $hash . '"';
|
$target = 'target="phpmain' . $hash . '"';
|
||||||
$onclick = '';
|
$onclick = '';
|
||||||
}
|
}
|
||||||
if ($cfg['MainPageIconic']) {
|
if ($cfg['MainPageIconic']) {
|
||||||
$query_frame_link_text = '<img src="' . $pmaThemeImage . 'b_selboard.png" border="0" hspace="1" width="16" height="16" alt="' . $strQueryFrame . '" title="' . $strQueryFrame . '"'
|
$query_frame_link_text = '<img src="' . $pmaThemeImage . 'b_selboard.png" border="0" hspace="1" width="16" height="16" alt="' . $strQueryFrame . '" title="' . $strQueryFrame . '"'
|
||||||
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />';
|
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />';
|
||||||
} else {
|
} else {
|
||||||
echo ($str_spacer_links != '' ? '<br />' : '');
|
echo ($str_spacer_links != '' ? '<br />' : '');
|
||||||
$query_frame_link_text = '<b>' . $strQueryFrame . '</b>';
|
$query_frame_link_text = '<b>' . $strQueryFrame . '</b>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
@@ -221,6 +223,7 @@ if ($cfg['MainPageIconic']) {
|
|||||||
<a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>" class="item"><?php echo $query_frame_link_text; ?></a>
|
<a href="<?php echo $href; ?>&no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>" class="item"><?php echo $query_frame_link_text; ?></a>
|
||||||
</noscript>
|
</noscript>
|
||||||
<?php
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
if ($cfg['MainPageIconic']) {
|
if ($cfg['MainPageIconic']) {
|
||||||
echo '<img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' .'" width="2" height="1" border="0" alt="" />'
|
echo '<img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' .'" width="2" height="1" border="0" alt="" />'
|
||||||
|
Reference in New Issue
Block a user