Skip to content
Browse files

Fixed Bug #723955, 723736, 723713 (Query Frame)

  • Loading branch information...
1 parent e53349b commit 210576b0aff5281ea7361a6c2887320efdb3e6ff Garvin Hicking committed Apr 20, 2003
Showing with 83 additions and 33 deletions.
  1. +9 −0 ChangeLog
  2. +10 −3 index.php3
  3. +12 −9 left.php3
  4. +1 −1 libraries/display_tbl.lib.php3
  5. +1 −1 queryframe.php3
  6. +23 −18 querywindow.php3
  7. +27 −1 tbl_query_box.php3
View
9 ChangeLog
@@ -5,6 +5,15 @@ phpMyAdmin - Changelog
$Id$
$Source$
+2003-04-20 Garvin Hicking <me@supergarv.de>
+ * libraries/display_tbl.lib.php3, index.php3, left.php3,
+ tbl_query_box.php3, queryframe.php3, querywindow.php3:
+ Fixed Bug #723955, 723736, 723713 (Query Frame). Workaround for
+ (serious) issues with multiple instances of phpMyAdmin and
+ the query window. Also made sure that disabling the QueryFrame
+ is possible without seeing errors. Of course, this is
+ extremely reduced usability without JS.
+
2003-04-18 Garvin Hicking <me@supergarv.de>
* left.php3, index.php3, tbl_query_box.php3,
libraries/display_tbl.lib.php3, queryframe.php3:
View
13 index.php3
@@ -48,6 +48,13 @@ $cfgRelation = PMA_getRelationsParam();
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
PMA_purgeHistory($cfg['Server']['user']);
}
+
+if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
+ $phpmain_hash = md5($cfg['PmaAbsoluteUri'] . time());
+} else {
+ $phpmain_hash = md5($cfg['PmaAbsoluteUri']);
+}
+
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
@@ -62,12 +69,12 @@ if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
<?php if ($cfg['QueryFrame']) {?>
<frameset rows="*, 50" framespacing="0" frameborder="0" border="0">
<?php } ?>
- <frame src="left.php3?<?php echo $url_query; ?>" name="nav" frameborder="0" />
+ <frame src="left.php3?<?php echo $url_query; ?>&amp;hash=<?php echo $phpmain_hash; ?>" name="nav" frameborder="0" />
<?php if ($cfg['QueryFrame']) { ?>
- <frame src="queryframe.php3?<?php echo $url_query; ?>" name="queryframe" frameborder="0" />
+ <frame src="queryframe.php3?<?php echo $url_query; ?>&amp;hash=<?php echo $phpmain_hash; ?>" name="queryframe" frameborder="0" />
</frameset>
<?php } ?>
- <frame src="<?php echo (empty($db)) ? 'main.php3' : $cfg['DefaultTabDatabase']; ?>?<?php echo $url_query; ?>" name="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" frameborder="1" />
+ <frame src="<?php echo (empty($db)) ? 'main.php3' : $cfg['DefaultTabDatabase']; ?>?<?php echo $url_query; ?>" name="phpmain<?php echo $phpmain_hash; ?>" frameborder="1" />
<noframes>
<body bgcolor="#FFFFFF">
View
21 left.php3
@@ -60,7 +60,7 @@ PMA_setFontSizes();
<head>
<title>phpMyAdmin</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
- <base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" />
+ <base<?php if (!empty($cfg['PmaAbsoluteUri'])) echo ' href="' . $cfg['PmaAbsoluteUri'] . '"'; ?> target="phpmain<?php echo $hash; ?>" />
<?php
// Expandable/collapsible databases list is only used if there is more than one
// database to display
@@ -252,10 +252,10 @@ if ($num_dbs > 1) {
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
?>
<nobr><img src="images/spacer.gif" border="0" width="9" height="9" alt="" />
- <a target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . htmlspecialchars($url_title); ?>">
+ <a target="phpmain<?php echo $hash; ?>" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . htmlspecialchars($url_title); ?>">
<img src="images/browse.png" width="8" height="8" border="0" alt="<?php echo $strBrowse . ': ' . $url_title; ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo>
<a class="tblItem" id="tbl_<?php echo md5($table); ?>" title="<?php echo htmlspecialchars($url_title); ?>"
-target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>">
+target="phpmain<?php echo $hash; ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>">
<?php echo ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)); ?></a></nobr><br />
<?php
} // end for $t (tables list)
@@ -286,12 +286,12 @@ target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="<?php echo $cfg
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
- $table_list .= ' <nobr><a target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '">' . "\n";
+ $table_list .= ' <nobr><a target="phpmain' . $hash . '" href="sql.php3?' . $common_url_query . '&amp;table=' . urlencode($table) . '&amp;sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&amp;pos=0&amp;goto=' . $cfg['DefaultTabTable'] . '">' . "\n";
$table_list .= ' <img src="images/browse.png" width="8" height="8" border="0" alt="' . $strBrowse . ': ' . $url_title . '" title="' . $strBrowse . ': ' . htmlspecialchars($url_title) . '" /></a><bdo dir="' . $text_dir . '">&nbsp;</bdo>' . "\n";
if (PMA_USR_BROWSER_AGENT == 'IE') {
- $table_list .= ' <span class="tblItem"><a class="tblItem" id="tbl_' . md5($table) . '" title="' . htmlspecialchars($url_title) . '" target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></span></nobr><br />' . "\n";
+ $table_list .= ' <span class="tblItem"><a class="tblItem" id="tbl_' . md5($table) . '" title="' . htmlspecialchars($url_title) . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></span></nobr><br />' . "\n";
} else {
- $table_list .= ' <a class="tblItem" id="tbl_' . md5($table) . '" title="' . htmlspecialchars($url_title) . '" target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
+ $table_list .= ' <a class="tblItem" id="tbl_' . md5($table) . '" title="' . htmlspecialchars($url_title) . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&amp;table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
}
} // end for $t (tables list)
@@ -301,7 +301,7 @@ target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="<?php echo $cfg
}
$selected = ' selected="selected"';
- $table_list_header .= ' <a class="item" target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '" href="' . $cfg['DefaultTabDatabase'] . '?' . $common_url_query . '">' . "\n";
+ $table_list_header .= ' <a class="item" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabDatabase'] . '?' . $common_url_query . '">' . "\n";
$table_list_header .= ' <span class="heada"><b>' . ($db_tooltip != '' && $cfg['ShowTooltipAliasTB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . '</b><bdo dir="' . $text_dir . '">&nbsp;&nbsp;</bdo></span></a><br />' . "\n\n";
} else {
$selected = '';
@@ -418,9 +418,9 @@ else if ($num_dbs == 1) {
echo "\n";
?>
- <nobr><a target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . htmlspecialchars($table); ?>">
+ <nobr><a target="phpmain<?php echo $hash; ?>" href="sql.php3?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>&amp;sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&amp;pos=0&amp;goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . htmlspecialchars($table); ?>">
<img src="images/browse.png" width="8" height="8" border="0" alt="<?php echo $strBrowse . ': ' . htmlspecialchars($table); ?>" /></a><bdo dir="<?php echo $text_dir; ?>">&nbsp;</bdo>
- <a class="tblItem" id="tbl_<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>">
+ <a class="tblItem" id="tbl_<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain<?php echo $hash; ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&amp;table=<?php echo urlencode($table); ?>">
<?php echo ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)); ?></a></nobr><br />
<?php
} // end for $j (tables list)
@@ -439,6 +439,9 @@ else {
echo "\n";
?>
+<form name="hashform" action="left.php3">
+ <input type="hidden" name="hash" value="<?php echo $hash; ?>">
+</form>
</body>
</html>
View
2 libraries/display_tbl.lib.php3
@@ -1001,7 +1001,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
} // end if (1.2.1)
if ($table == $GLOBALS['cfg']['Bookmark']['table'] && $db == $GLOBALS['cfg']['Bookmark']['db']) {
- $bookmark_go = '<form method="post" target="phpmain' . md5($GLOBALS['cfg']['PmaAbsoluteUri']) . '" action="read_dump.php3">'
+ $bookmark_go = '<form method="post" action="read_dump.php3">'
. PMA_generate_common_hidden_inputs($row['dbase'], '')
. '<input type="hidden" name="id_bookmark" value="' . $row['id'] . '" />'
. '<input type="hidden" name="action_bookmark" value="0" />'
View
2 queryframe.php3
@@ -91,7 +91,7 @@ if ($cfg['QueryFrameJS']) {
$onclick = 'onClick="javascript:open_querywindow(this.href); return false;"';
} else {
$href = $anchor;
- $target = 'target="phpmain' . md5($cfg['PmaAbsoluteUri']) . '"';
+ $target = 'target="phpmain' . $hash . '"';
$onclick = '';
}
?>
View
41 querywindow.php3
@@ -92,27 +92,32 @@ var confirmMsg = '<?php echo(($GLOBALS['cfg']['Confirm']) ? str_replace('\'', '
<body bgcolor="<?php echo ($cfg['QueryFrameJS'] ? $cfg['LeftBgColor'] : $cfg['RightBgColor']); ?>">
<?php
-$querydisplay_tab = (isset($querydisplay_tab) ? $querydisplay_tab : $cfg['QueryWindowDefTab']);
+if ($cfg['QueryFrameJS']) {
+ $querydisplay_tab = (isset($querydisplay_tab) ? $querydisplay_tab : $cfg['QueryWindowDefTab']);
+
+ if ($cfg['LightTabs']) {
+ echo '&nbsp;';
+ } else {
+ echo '<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
+ <tr>
+ <td width="8">&nbsp;</td>';
+ }
+ echo "\n";
+ echo PMA_printTab($strSQL, '#', '', 'onClick="javascript:query_tab_commit(\'sql\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'sql' ? TRUE : FALSE));
+ echo PMA_printTab($strImportFiles, '#', '', 'onClick="javascript:query_tab_commit(\'files\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'files' ? TRUE : FALSE));
+ echo PMA_printTab($strQuerySQLHistory, '#', '', 'onClick="javascript:query_tab_commit(\'history\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'history' ? TRUE : FALSE));
-if ($cfg['LightTabs']) {
- echo '&nbsp;';
-} else {
- echo '<table border="0" cellspacing="0" cellpadding="3" width="100%" class="tabs">
- <tr>
- <td width="8">&nbsp;</td>';
-}
-echo "\n";
-echo PMA_printTab($strSQL, '#', '', 'onClick="javascript:query_tab_commit(\'sql\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'sql' ? TRUE : FALSE));
-echo PMA_printTab($strImportFiles, '#', '', 'onClick="javascript:query_tab_commit(\'files\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'files' ? TRUE : FALSE));
-echo PMA_printTab($strQuerySQLHistory, '#', '', 'onClick="javascript:query_tab_commit(\'history\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'history' ? TRUE : FALSE));
-if ($cfg['QueryWindowDefTab'] == 'full') {
- echo PMA_printTab($strAll, '#', '', 'onClick="javascript:query_tab_commit(\'full\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'full' ? TRUE : FALSE));
-}
+ if ($cfg['QueryWindowDefTab'] == 'full') {
+ echo PMA_printTab($strAll, '#', '', 'onClick="javascript:query_tab_commit(\'full\');return false;"', '', (isset($querydisplay_tab) && $querydisplay_tab == 'full' ? TRUE : FALSE));
+ }
-if (!$cfg['LightTabs']) {
- echo '</tr></table>';
+ if (!$cfg['LightTabs']) {
+ echo '</tr></table>';
+ } else {
+ echo '<br />';
+ }
} else {
- echo '<br />';
+ $querydisplay_tab = 'full';
}
?>
View
28 tbl_query_box.php3
@@ -55,7 +55,7 @@ $auto_sel = ($cfg['TextareaAutoSelect']
// garvin: If non-JS query window is embedded, display a list of databases to choose from.
// Apart from that, a non-js query window sucks badly.
-if ($cfg['QueryFrame'] && (!$cfg['QueryFrameJS'] || ($cfg['QueryFrameJS'] && !$db))) {
+if ($cfg['QueryFrame'] && (!$cfg['QueryFrameJS'] && !$db || ($cfg['QueryFrameJS'] && !$db))) {
/**
* Get the list and number of available databases.
*/
@@ -77,8 +77,18 @@ if ($cfg['QueryFrame'] && (!$cfg['QueryFrameJS'] || ($cfg['QueryFrameJS'] && !$d
$queryframe_db_list = '';
}
+if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
+?>
+ <script>
+ document.writeln('<form method="post" target="phpmain' + <?php echo ((isset($is_inside_querywindow) && $is_inside_querywindow == TRUE) ? 'opener.' : ''); ?>top.frames.nav.document.hashform.hash.value + '" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; ?>');
+ </script>
+<?php
+} else {
?>
<form method="post" target="phpmain<?php echo md5($cfg['PmaAbsoluteUri']); ?>" action="read_dump.php3"<?php if ($is_upload) echo ' enctype="multipart/form-data"'; echo "\n"; ?>
+<?php
+}
+?>
onsubmit="return checkSqlQuery(this)" name="sqlform">
<input type="hidden" name="is_js_confirmed" value="0" />
<?php echo PMA_generate_common_hidden_inputs($db, $table); ?>
@@ -278,7 +288,23 @@ if (!isset($is_inside_querywindow) ||
<!-- Insert a text file -->
<br /><br />
<li>
+ <?php
+ if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
+ ?>
+
+ <script>
+ document.writeln('<div style="margin-bottom: 10px"><a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.top.frames.phpmain\' + opener.top.frames.nav.document.hashform.hash.value + \'.location.href = \'' . $ldi_target . '\'; return false;"' : ''); ?>><?php echo $strInsertTextfiles; ?></a></div>');
+ </script>
+
+ <?php
+ } else {
+ ?>
+
<div style="margin-bottom: 10px"><a href="<?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? '#' : $ldi_target); ?>" <?php echo (isset($is_inside_querywindow) && $is_inside_querywindow == TRUE ? 'onclick="opener.top.frames.phpmain' . md5($cfg['PmaAbsoluteUri']) . '.location.href = \'' . $ldi_target . '\'; return false;"' : ''); ?>><?php echo $strInsertTextfiles; ?></a></div>
+
+ <?php
+ }
+ ?>
</li>
<?php
}

0 comments on commit 210576b

Please sign in to comment.
Something went wrong with that request. Please try again.