Handle correctly situation with no default server (bug #1049107).

This commit is contained in:
Michal Čihař
2004-10-19 13:46:02 +00:00
parent 330e83d6df
commit 34e3a84aa3
3 changed files with 54 additions and 49 deletions

View File

@@ -11,6 +11,8 @@ $Source$
* sql.php: Fix undefined index.
* libraries/sqlparser.lib.php: Return raw query in case of error (bug
#1048826).
* main.php, queryframe.php: Handle correctly situation with no default
server (bug #1049107).
2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to boralioglu.

View File

@@ -538,7 +538,7 @@ if (empty($cfg['Lang'])) {
}
if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
&& $allow_recoding && PMA_MYSQL_INT_VERSION < 40100) {
&& $server != 0 && $allow_recoding && PMA_MYSQL_INT_VERSION < 40100) {
echo "\n";
?>
<!-- Charset Selection -->
@@ -569,7 +569,7 @@ if (isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding']
</td>
</tr>
<?php
} elseif (PMA_MYSQL_INT_VERSION >= 40100) {
} elseif ($server != 0 && PMA_MYSQL_INT_VERSION >= 40100) {
echo ' <!-- Charset Info -->' . "\n"
. ' <tr>' . "\n"
.' ' . ($str_iconic_list != '' ? sprintf($str_iconic_list,'','s_asci.png',$strMySQLCharset,'') : $str_normal_list) . "\n"

View File

@@ -183,6 +183,8 @@ if ($cfg['MainPageIconic']) {
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />'
: '<b>' . $strHome . '</b>')
. '</a>';
// if we have chosen server
if ($server != 0) {
// Logout for advanced authentication
if ($cfg['Server']['auth_type'] != 'config') {
echo $str_spacer_links;
@@ -194,23 +196,23 @@ if ($cfg['MainPageIconic']) {
. '</a>';
} // end if
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
if ($cfg['QueryFrameJS']) {
$anchor = 'querywindow.php?' . PMA_generate_common_url('', '');
if ($cfg['QueryFrameJS']) {
$href = $anchor;
$target = '';
$onclick = 'onclick="javascript:open_querywindow(this.href); return false;"';
} else {
} else {
$href = $anchor;
$target = 'target="phpmain' . $hash . '"';
$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 . '"'
.' onmouseover="this.style.backgroundColor=\'#ffffff\';" onmouseout="this.style.backgroundColor=\'\';" align="middle" />';
} else {
} else {
echo ($str_spacer_links != '' ? '<br />' : '');
$query_frame_link_text = '<b>' . $strQueryFrame . '</b>';
}
}
?>
<script type="text/javascript">
<!--
@@ -221,6 +223,7 @@ if ($cfg['MainPageIconic']) {
<a href="<?php echo $href; ?>&amp;no_js=true" <?php echo $target . ' ' . $onclick; ?> target="phpmain<?php echo $hash; ?>" class="item"><?php echo $query_frame_link_text; ?></a>
</noscript>
<?php
}
if ($cfg['MainPageIconic']) {
echo '<img src="' .$GLOBALS['pmaThemeImage'] . 'spacer.png' .'" width="2" height="1" border="0" alt="" />'