-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
73 lines (64 loc) · 1.76 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
define('ASSETS_VERSION', '1');
include __DIR__ . '/adminer.php';
include __DIR__ . '/functions.php';
function getPlugins()
{
$plugins = [
new AdminerDisableJush,
new AdminerAutocomplete,
new AdminerSaveMenuPos,
new AdminerRemoteColor,
new AdminerDumpJson,
new AdminerDumpPhpPrototype,
new AdminerTablesFilter,
new AdminerLoginWithoutCredentials,
new AdminerEditCalendar,
new AdminerEnumOption,
new AdminerColorfields,
new AdminerDatabaseHide([
'information_schema',
'mysql',
'performance_schema',
'sys',
]),
new searchAutocomplete,
new FillLoginForm('server', '', 'root', '')
];
if (getenv('ADMINER_SERVER') && getenv('ADMINER_USERNAME')) {
if (!isset($_GET['username'])) {
$_GET['username'] = '';
}
class AdminerCustomization extends AdminerPlugin
{
public function credentials()
{
$server = getenv('ADMINER_SERVER');
$username = getenv('ADMINER_USERNAME');
$password = getenv('ADMINER_PASSWORD');
return [$server, $username, $password];
}
}
return new AdminerCustomization($plugins);
}
return new AdminerPlugin($plugins);
}
function includeAdminerPluginFile()
{
include_once __DIR__ . '/plugins/plugin.php';
}
function includeOtherPlugins()
{
$pluginFiles = glob(__DIR__ . '/plugins/*.php');
foreach ($pluginFiles as $filename) {
include_once $filename;
}
}
function adminer_object()
{
includeAdminerPluginFile();
includeOtherPlugins();
return getPlugins();
}
redirectToHttps();
handleFileRequest();