function adminer_object() { class AdminerExtension extends Adminer { // there will be methods we would like to overwrite } return new AdminerExtension; } include "./adminer.php";
Documented at project home page
htmlspecialchars
magic_quotes_gpc
, mysql_real_escape_string
session_regenerate_id
<meta name="robots" content="noindex">
Referer
protection
adminer.css
name
class AdminerExtension extends Adminer { function name() { return "WebAdmin"; } }
tableName
and fieldName
class AdminerExtension extends Adminer { function tableName($tableStatus) { return h($tableStatus["Comment"]); } function fieldName($field, $order = 0) { return h($field["comment"]); } }
selectVal
to change the way of displaying values (alignment, booleans, images, …)
class AdminerExtension extends Adminer { function selectVal($val, $link, $field) { if (preg_match('~blob$~', $field["type"])) { return "" . lang('download') . ""; } return parent::selectVal($val, $link, $field); } }
credentials
method is passed to the database server, database
method chooses a database
class AdminerExtension extends Adminer { function credentials() { return array("localhost", "web", "GxAY2N0Z"); } function database() { return "shop"; } }
login
method to authenticate a user
class AdminerExtension extends Adminer { function login($login, $password) { $connection = connection(); $row = $connection->query(" SELECT id FROM users WHERE login = " . $connection->quote($login) . " AND password_sha1 = '" . sha1($password) . "' ")->fetch_assoc(); return (bool) $row; } }
loginForm
method to customize the login form
permanentLogin
returns the cryptographic key for storing passwords in cookies
class AdminerExtension extends Adminer { function permanentLogin() { return "afdf468e52af69a1d96bae63a2b81957"; } }