mirror of
https://github.com/vrana/adminer.git
synced 2026-01-05 23:30:44 +01:00
Adminer class
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@913 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -1,36 +1,41 @@
|
||||
<?php
|
||||
class Adminer {
|
||||
function adminer_object() {
|
||||
|
||||
function name() {
|
||||
// custom name in title and heading
|
||||
return 'CDs';
|
||||
}
|
||||
|
||||
function credentials() {
|
||||
// ODBC user without password on localhost
|
||||
return array('localhost', 'ODBC', '');
|
||||
}
|
||||
|
||||
function database() {
|
||||
// will be escaped by Adminer
|
||||
return 'adminer_test';
|
||||
}
|
||||
|
||||
function login($login, $password) {
|
||||
// username: admin, password: anything
|
||||
return ($login == 'admin');
|
||||
}
|
||||
|
||||
function table_name($row) {
|
||||
// tables without comments would return empty string and will be ignored by Adminer
|
||||
return htmlspecialchars($row["Comment"]);
|
||||
}
|
||||
|
||||
function field_name($field) {
|
||||
// fields without comments will be ignored
|
||||
return ($field ? htmlspecialchars($field["comment"]) : "*");
|
||||
class AdminerCds extends Adminer {
|
||||
|
||||
function name() {
|
||||
// custom name in title and heading
|
||||
return 'CDs';
|
||||
}
|
||||
|
||||
function credentials() {
|
||||
// ODBC user without password on localhost
|
||||
return array('localhost', 'ODBC', '');
|
||||
}
|
||||
|
||||
function database() {
|
||||
// will be escaped by Adminer
|
||||
return 'adminer_test';
|
||||
}
|
||||
|
||||
function login($login, $password) {
|
||||
// username: 'admin', password: anything
|
||||
return ($login == 'admin');
|
||||
}
|
||||
|
||||
function tableName($row) {
|
||||
// tables without comments would return empty string and will be ignored by Adminer
|
||||
return htmlspecialchars($row["Comment"]);
|
||||
}
|
||||
|
||||
function fieldName($field) {
|
||||
// fields without comments will be ignored
|
||||
return ($field ? htmlspecialchars($field["comment"]) : "*");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new AdminerCds;
|
||||
}
|
||||
|
||||
include "./index.php";
|
||||
|
||||
Reference in New Issue
Block a user