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. * 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.

View File

@@ -538,7 +538,7 @@ if (empty($cfg['Lang'])) {
} }
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,7 +569,7 @@ 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"

View File

@@ -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() . '&amp;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() . '&amp;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; ?>&amp;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; ?>&amp;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="" />'