1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Centralize common variables

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@842 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-16 14:06:33 +00:00
parent e2a03c08c3
commit 08dc4b654e
3 changed files with 9 additions and 25 deletions

View File

@@ -8,21 +8,9 @@
include "../adminer/include/bootstrap.inc.php";
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
$error = "";
if (isset($_GET["download"])) {
include "../adminer/download.inc.php";
} else { // uses CSRF token
$token = $_SESSION["tokens"][$_GET["server"]];
if ($_POST) {
if ($_POST["token"] != $token) {
$error = lang('Invalid CSRF token. Send the form again.');
}
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
// posted form with no data means exceeded post_max_size because Adminer always sends token at least
$error = lang('Too big POST data. Reduce the data or increase the "post_max_size" configuration directive.');
}
} else {
if (isset($_GET["select"]) && ($_POST["edit"] || $_POST["clone"]) && !$_POST["save"]) {
$_GET["edit"] = $_GET["select"];
}