Skip to content
Browse files

Hide SQL command link in case of an error

  • Loading branch information...
1 parent d49903b commit f7d458788033eb98621964c0bfaf50e4680bd519 @vrana committed Oct 18, 2010
Showing with 9 additions and 5 deletions.
  1. +9 −5 adminer/include/adminer.inc.php
View
14 adminer/include/adminer.inc.php
@@ -523,10 +523,14 @@ function navigation($missing) {
?>
<form action="" method="post">
<p class="logout">
-<a href="<?php echo h(ME); ?>sql="><?php echo bold(lang('SQL command'), isset($_GET["sql"])); ?></a>
-<?php if (support("dump")) { ?>
-<a href="<?php echo h(ME); ?>dump=<?php echo urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]); ?>"><?php echo bold(lang('Dump'), isset($_GET["dump"])); ?></a>
-<?php } ?>
+<?php
+if (DB == "" || !$missing) {
+ echo "<a href='" . h(ME) . "sql='>" . bold(lang('SQL command'), isset($_GET["sql"])) . "</a>\n";
+ if (support("dump")) {
+ echo "<a href='" . h(ME) . "dump=" . urlencode(isset($_GET["table"]) ? $_GET["table"] : $_GET["select"]) . "'>" . bold(lang('Dump'), isset($_GET["dump"])) . "</a>\n";
+ }
+}
+?>
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>">
</p>
@@ -544,7 +548,7 @@ function navigation($missing) {
set_schema($_GET["ns"]);
}
}
- if ($_GET["ns"] !== "" && $missing != "ns") {
+ if ($_GET["ns"] !== "" && !$missing) {
$tables = tables_list();
if (!$tables) {
echo "<p class='message'>" . lang('No tables.') . "\n";

0 comments on commit f7d4587

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