Move back to the welcome page if the current database has been dropped

This commit is contained in:
Loïc Chapeaux
2001-08-19 00:55:58 +00:00
parent 34565035d9
commit 66f4571e8d
2 changed files with 28 additions and 11 deletions

View File

@@ -20,6 +20,11 @@ if (!isset($message)) {
// 1. Gets the list of the tables
$tables = mysql_list_tables($db);
$num_tables = @mysql_numrows($tables);
// Not a valid db name -> back to the welcome page
if (mysql_error() != '') {
header('Location: main.php3?lang=' . $lang . '&server=' . $server . '&reload=true');
exit();
}
// speedup view on locked tables - staybyte - 11 June 2001
if ($num_tables > 0 && MYSQL_MAJOR_VERSION >= 3.23 && intval(MYSQL_MINOR_VERSION) >= 3) {
@@ -200,16 +205,16 @@ else if (MYSQL_MAJOR_VERSION >= 3.23 && isset($tbl_cache)) {
?>
<tr bgcolor="<?php echo $cfgThBgcolor; ?>">
<td align="center">
<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)) . "\n"; ?></b>
<b><?php echo sprintf($strTables, number_format($num_tables, 0, $number_decimal_separator, $number_thousands_separator)); ?></b>
</td>
<td colspan="6" align="center">
<b><?php echo $strSum . "\n"; ?></b>
<b><?php echo $strSum; ?></b>
</td>
<td align="right" nowrap="nowrap">
<b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator) . "\n"; ?></b>
<b><?php echo number_format($sum_entries, 0, $number_decimal_separator, $number_thousands_separator); ?></b>
</td>
<td align="right" nowrap="nowrap">
<b><?php echo $sum_formated . ' '. $unit . "\n"; ?></b>
<b><?php echo $sum_formated . ' '. $unit; ?></b>
</td>
</tr>
</table>

View File

@@ -10,6 +10,18 @@ require('./header.inc.php3');
if (isset($message)) {
show_message($message);
}
else if (!empty($reload) && $reload == 'true') {
// Reloads the navigation frame via JavaScript if required
echo "\n";
?>
<script type="text/javascript" language="javascript1.2">
<!--
window.parent.frames['nav'].location.replace('./left.php3?lang=<?php echo $lang; ?>&server=<?php echo $server; ?>');
//-->
</script>
<?php
}
echo "\n";
/**
@@ -261,26 +273,26 @@ if ($server > 0
<?php echo $strReloadMySQL; ?></a>&nbsp;<?php echo show_docu('manual_Reference.html#FLUSH') . "\n"; ?>
</li>
<br /><br />
<?php
$result = mysql_query('SELECT * FROM mysql.user');
$rows = @mysql_num_rows($result);
if (!empty($rows)) {
echo "\n";
?>
<li>
<li>
<a href="user_details.php3?<?php echo $common_url_query; ?>&db=mysql&table=user">
<?php echo $strUsers; ?></a>&nbsp;<?php echo show_docu('manual_Privilege_system.html#Privilege_system') . "\n"; ?>
</li>
<?php echo $strUsers; ?></a>&nbsp;<?php echo show_docu('manual_Privilege_system.html#Privilege_system') . "\n"; ?>
</li>
<?php
echo "\n";
}
} // end of 2.2 (no AdvAuth case)
} // end of 2: if ($server > 0)
?>
<!-- PHP Information -->
<li>
<a href="phpinfo.php3" target="_new"><?php echo $strShowPHPInfo; ?></a>
<a href="phpinfo.php3" target="_new"><?php echo $strShowPHPInfo; ?></a>
</li>
<!-- documentation -->
@@ -292,7 +304,7 @@ if ($server > 0
</li>
<li>
<a href="http://phpmyadmin.sourceforge.net/" target="_new">
<?php echo $strHomepageSourceforge; ?></a>&nbsp;&nbsp;&nbsp;
<?php echo $strHomepageSourceforge; ?></a>&nbsp;&nbsp;&nbsp;
[<a href="ChangeLog" target="_new">ChangeLog</a>]&nbsp;
[<a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpmyadmin/phpMyAdmin/" target="_new">CVS</a>]
</li>