Separate history for server and database
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@655 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
10bdbed14f
commit
66a04f36e6
|
@ -33,6 +33,7 @@ if (isset($_POST["server"])) {
|
||||||
unset($_SESSION["passwords"][$_GET["server"]]);
|
unset($_SESSION["passwords"][$_GET["server"]]);
|
||||||
unset($_SESSION["databases"][$_GET["server"]]);
|
unset($_SESSION["databases"][$_GET["server"]]);
|
||||||
unset($_SESSION["tokens"][$_GET["server"]]);
|
unset($_SESSION["tokens"][$_GET["server"]]);
|
||||||
|
unset($_SESSION["history"][$_GET["server"]]);
|
||||||
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
|
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,8 +96,8 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
|
||||||
$id = "sql-" . count($_SESSION["messages"]);
|
$id = "sql-" . count($_SESSION["messages"]);
|
||||||
$sql = "";
|
$sql = "";
|
||||||
if ($query) {
|
if ($query) {
|
||||||
$sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> <a href="' . htmlspecialchars($SELF) . 'sql=&history=' . count($_SESSION["history"]) . '">' . lang('Edit') . '</a></span>';
|
$sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><br /><code class='jush-sql'>" . htmlspecialchars($query) . '</code> <a href="' . htmlspecialchars($SELF) . 'sql=&history=' . count($_SESSION["history"][$_GET["server"]][$_GET["db"]]) . '">' . lang('Edit') . '</a></span>';
|
||||||
$_SESSION["history"][] = $query;
|
$_SESSION["history"][$_GET["server"]][$_GET["db"]][] = $query;
|
||||||
}
|
}
|
||||||
if ($execute) {
|
if ($execute) {
|
||||||
$failed = !$dbh->query($query);
|
$failed = !$dbh->query($query);
|
||||||
|
|
|
@ -67,7 +67,7 @@ if (!$error && $_POST) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["history"]] : $_GET["sql"])); ?></textarea></p>
|
<p><textarea name="query" rows="20" cols="80" style="width: 98%;"><?php echo htmlspecialchars($_POST ? $_POST["query"] : (strlen($_GET["history"]) ? $_SESSION["history"][$_GET["server"]][$_GET["db"]][$_GET["history"]] : $_GET["sql"])); ?></textarea></p>
|
||||||
<p>
|
<p>
|
||||||
<input type="hidden" name="token" value="<?php echo $token; ?>" />
|
<input type="hidden" name="token" value="<?php echo $token; ?>" />
|
||||||
<input type="submit" value="<?php echo lang('Execute'); ?>" />
|
<input type="submit" value="<?php echo lang('Execute'); ?>" />
|
||||||
|
|
Loading…
Reference in a new issue