those operations do not make sense on information_schema

This commit is contained in:
Marc Delisle
2005-07-22 16:26:49 +00:00
parent dba40399cb
commit 064568ff4a
2 changed files with 67 additions and 53 deletions

View File

@@ -8,6 +8,8 @@ $Source$
2005-07-22 Marc Delisle <lem9@users.sourceforge.net>
* db_details_structure.php: table creation should not be possible
in information_schema
* db_operations.php: those operations do not make sense on
information_schema
2005-07-21 Marc Delisle <lem9@users.sourceforge.net>
* libraries/auth/cookie.auth.lib.php: bug #1240880, XSS on the

View File

@@ -134,6 +134,13 @@ if (empty($is_info)) {
if (PMA_MYSQL_INT_VERSION >= 40101) {
$db_collation = PMA_getDbCollation($db);
}
if (PMA_MYSQL_INT_VERSION < 50002 || (PMA_MYSQL_INT_VERSION >= 50002 && $db != 'information_schema')) {
$is_information_schema = FALSE;
} else {
$is_information_schema = TRUE;
}
if (!$is_information_schema) {
?>
<table border="0" cellpadding="2" cellspacing="0">
@@ -148,27 +155,28 @@ if (PMA_MYSQL_INT_VERSION >= 40101) {
. htmlspecialchars($GLOBALS['db']) . '</a>';
// else use
// $strDBLink = htmlspecialchars($db);
echo ' ' . sprintf($strCreateNewTable, $strDBLink) . ':&nbsp;' . "\n";
echo ' </td></tr>';
echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
echo ' ' . $strName . ':&nbsp;' . "\n";
echo ' </td>';
echo ' <td nowrap="nowrap">';
echo ' ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
echo ' </td><td>&nbsp;</td></tr>';
echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
echo ' ' . $strFields . ':&nbsp;' . "\n";
echo ' </td>';
echo ' <td nowrap="nowrap">';
echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
echo ' </td>';
echo ' <td align="right">';
echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
echo ' </td> </tr>';
echo ' </form>';
echo ' ' . sprintf($strCreateNewTable, $strDBLink) . ':&nbsp;' . "\n";
echo ' </td></tr>';
echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
echo ' ' . $strName . ':&nbsp;' . "\n";
echo ' </td>';
echo ' <td nowrap="nowrap">';
echo ' ' . '<input type="text" name="table" maxlength="64" size="30" class="textfield" />';
echo ' </td><td>&nbsp;</td></tr>';
echo ' <tr bgcolor="'.$cfg['BgcolorOne'].'"><td nowrap="nowrap">';
echo ' ' . $strFields . ':&nbsp;' . "\n";
echo ' </td>';
echo ' <td nowrap="nowrap">';
echo ' ' . '<input type="text" name="num_fields" size="2" class="textfield" />' . "\n";
echo ' </td>';
echo ' <td align="right">';
echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
echo ' </td> </tr>' . "\n";
echo ' </form>' . "\n";
echo '</table>' . "\n";
echo '<table border="0" cellpadding="2" cellspacing="0">';
if ($cfgRelation['commwork']) {
echo '<table border="0" cellpadding="2" cellspacing="0">';
if ($cfgRelation['commwork']) {
?>
<!-- Alter/Enter db-comment -->
<tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr>
@@ -191,7 +199,7 @@ if ($cfgRelation['commwork']) {
</td></tr>
</form>
<?php
}
}
?>
<!-- Rename database -->
<tr><td colspan="3"><img src="<?php echo $GLOBALS['pmaThemeImage'] . 'spacer.png'; ?>" width="1" height="1" border="0" alt="" /></td></tr>
@@ -255,7 +263,7 @@ if ($cfgRelation['commwork']) {
<?php
if (PMA_MYSQL_INT_VERSION >= 40101) {
if (PMA_MYSQL_INT_VERSION >= 40101) {
// MySQL supports setting default charsets / collations for databases since
// version 4.1.1.
echo ' <!-- Change database charset -->' . "\n"
@@ -275,22 +283,26 @@ if (PMA_MYSQL_INT_VERSION >= 40101) {
. ' </td></tr>' . "\n"
. ' </form>' . "\n"
. ' ' . "\n\n";
}
}
if ($num_tables > 0
if ($num_tables > 0
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == FALSE) {
echo '<tr><td colspan="3"><img src="' . $GLOBALS['pmaThemeImage'] . 'spacer.png' . '" width="1" height="1" border="0" alt="" /></td></tr>'
. '<tr><th colspan="3" class="tblHeadError"><div class="errorhead">' . $strError . '</div></th></tr>'
. '<tr><td colspan="3" class="tblError">'
. sprintf(wordwrap($strRelationNotWorking,65,'<br />'), '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', '</a>')
. '</td></tr>';
} // end if
} // end if
?>
</table>
<?php
} // end if (!$is_information_schema)
// not sure about leaving the PDF dialog for information_schema
?>
<form method="post" action="pdf_schema.php">
<?php
// is this OK to check for 'class' support?
if ($num_tables > 0) {
$takeaway = $url_query . '&amp;table=' . urlencode($table);
}