Document variables

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1278 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-12-18 15:36:57 +00:00
parent 16592e48bb
commit b69ae2f500
2 changed files with 9 additions and 3 deletions

View file

@ -1,7 +1,12 @@
<?php
class Adminer {
/** @var array functions used in select */
var $functions = array("char_length", "from_unixtime", "hex", "lower", "round", "sec_to_time", "time_to_sec", "unix_timestamp", "upper");
/** @var array grouping functions used in select */
var $grouping = array("avg", "count", "count distinct", "group_concat", "max", "min", "sum");
/** @var array operators used in select */
var $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "REGEXP", "IN", "IS NULL", "NOT LIKE", "NOT REGEXP", "NOT IN", "IS NOT NULL");
/** Name in title and navigation

View file

@ -76,7 +76,6 @@ if (function_exists("set_magic_quotes_runtime")) {
define("DB", $_GET["db"]); // for the sake of speed and size
define("ME", preg_replace('~^[^?]*/([^?]*).*~', '\\1', $_SERVER["REQUEST_URI"]) . '?' . (SID ? SID . '&' : '') . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen(DB) ? 'db=' . urlencode(DB) . '&' : ''));
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); // used in foreign_keys()
include "../adminer/include/version.inc.php";
include "../adminer/include/functions.inc.php";
@ -96,8 +95,10 @@ if (!ini_get("session.use_cookies") || @ini_set("session.use_cookies", false) !=
session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later
}
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
$token = $_SESSION["tokens"][$_GET["server"]];
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION"); ///< @var array used in foreign_keys()
$confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\""; ///< @var string
$token = $_SESSION["tokens"][$_GET["server"]]; ///< @var string CSRF protection
/** @var string */
$error = ($_POST
? ($_POST["token"] == $token ? "" : lang('Invalid CSRF token. Send the form again.'))
: ($_SERVER["REQUEST_METHOD"] != "POST" ? "" : lang('Too big POST data. Reduce the data or increase the %s configuration directive.', '"post_max_size"')) // posted form with no data means that post_max_size exceeded because Adminer always sends token at least