Move logout token to page_header()

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@390 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2008-04-15 12:06:08 +00:00
parent 0ce28f96f8
commit 0775cda458

View file

@ -43,6 +43,9 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
echo "<p class='message'>$_SESSION[message]</p>\n";
$_SESSION["message"] = "";
}
if (!$_SESSION["tokens"][$_GET["server"]]["?logout"]) {
$_SESSION["tokens"][$_GET["server"]]["?logout"] = rand(1, 1e6);
}
if (isset($_SESSION["databases"][$_GET["server"]]) && !isset($_GET["sql"])) {
session_write_close();
}
@ -65,9 +68,6 @@ function page_footer($missing = false) {
<a href="<?php echo htmlspecialchars($SELF); ?>sql="><?php echo lang('SQL command'); ?></a>
<a href="<?php echo htmlspecialchars($SELF); ?>dump=<?php echo urlencode($_GET["table"]); ?>"><?php echo lang('Dump'); ?></a>
<input type="hidden" name="token" value="<?php
if (!$_SESSION["tokens"][$_GET["server"]]["?logout"]) {
$_SESSION["tokens"][$_GET["server"]]["?logout"] = rand(1, 1e6);
}
echo $_SESSION["tokens"][$_GET["server"]]["?logout"];
?>" />
<input type="submit" name="logout" value="<?php echo lang('Logout'); ?>" />