Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (28 sloc) 0.751 kb
70b7207 Customization example
jakubvrana authored
1 <?php
2 class Adminer {
3
4 function name() {
c325cbe Comments
jakubvrana authored
5 // custom name in title and heading
70b7207 Customization example
jakubvrana authored
6 return 'CDs';
7 }
8
9 function credentials() {
c325cbe Comments
jakubvrana authored
10 // ODBC user without password on localhost
70b7207 Customization example
jakubvrana authored
11 return array('localhost', 'ODBC', '');
12 }
13
14 function database() {
c325cbe Comments
jakubvrana authored
15 // will be escaped by Adminer
b2107e8 Rename test database
jakubvrana authored
16 return 'adminer_test';
70b7207 Customization example
jakubvrana authored
17 }
18
2faa08c Customize login and login form
jakubvrana authored
19 function login($login, $password) {
c325cbe Comments
jakubvrana authored
20 // username: admin, password: anything
2faa08c Customize login and login form
jakubvrana authored
21 return ($login == 'admin');
22 }
23
116c873 Ignore tables and fields with empty name
jakubvrana authored
24 function table_name($row) {
c325cbe Comments
jakubvrana authored
25 // tables without comments would return empty string and will be ignored by Adminer
116c873 Ignore tables and fields with empty name
jakubvrana authored
26 return htmlspecialchars($row["Comment"]);
27 }
28
5034123 Apply field name with functions
jakubvrana authored
29 function field_name($field) {
c325cbe Comments
jakubvrana authored
30 // fields without comments will be ignored
5034123 Apply field name with functions
jakubvrana authored
31 return ($field ? htmlspecialchars($field["comment"]) : "*");
116c873 Ignore tables and fields with empty name
jakubvrana authored
32 }
33
70b7207 Customization example
jakubvrana authored
34 }
35
1e92cfe Don't compile editor for example
jakubvrana authored
36 include "./index.php";
Something went wrong with that request. Please try again.