2009-07-20 15:47:12 +00:00
|
|
|
<?php
|
2009-07-27 11:25:37 +00:00
|
|
|
function adminer_object() {
|
2009-07-20 15:47:12 +00:00
|
|
|
|
2009-07-27 11:25:37 +00:00
|
|
|
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');
|
|
|
|
}
|
|
|
|
|
2009-07-27 16:51:40 +00:00
|
|
|
function tableName($tableStatus) {
|
2009-07-27 11:25:37 +00:00
|
|
|
// tables without comments would return empty string and will be ignored by Adminer
|
2009-07-28 16:20:50 +00:00
|
|
|
return h($tableStatus["Comment"]);
|
2009-07-27 11:25:37 +00:00
|
|
|
}
|
|
|
|
|
2009-07-27 16:51:40 +00:00
|
|
|
function fieldName($field, $order = 0) {
|
2010-11-02 09:29:32 +00:00
|
|
|
if ($order && ereg('_(md5|sha1)$', $field["field"])) {
|
|
|
|
return ""; // hide hashes in select
|
|
|
|
}
|
2009-07-31 09:43:53 +00:00
|
|
|
// only columns with comments will be displayed and only the first five in select
|
2010-10-24 09:43:03 +00:00
|
|
|
return ($order <= 5 ? h($field["comment"]) : "");
|
2009-07-27 11:25:37 +00:00
|
|
|
}
|
|
|
|
|
2009-07-21 13:59:02 +00:00
|
|
|
}
|
|
|
|
|
2009-07-27 11:25:37 +00:00
|
|
|
return new AdminerCds;
|
2009-07-20 15:47:12 +00:00
|
|
|
}
|
|
|
|
|
2009-07-24 16:18:51 +00:00
|
|
|
include "./index.php";
|