diff --git a/adminer/plugin.php b/adminer/plugin.php index 082817d3..dac12efe 100644 --- a/adminer/plugin.php +++ b/adminer/plugin.php @@ -10,6 +10,7 @@ function adminer_object() { $plugins = array( // specify enabled plugins here + new AdminerDatabaseHide(array('information_schema')), new AdminerDumpZip, new AdminerDumpXml, //~ new AdminerSqlLog("past-" . rtrim(`git describe --tags --abbrev=0`) . ".sql"), diff --git a/plugins/database-hide.php b/plugins/database-hide.php new file mode 100644 index 00000000..19d45305 --- /dev/null +++ b/plugins/database-hide.php @@ -0,0 +1,28 @@ +disabled = array_map('strtolower', $disabled); + } + + function databases($flush = true) { + $return = array(); + foreach (get_databases($flush) as $db) { + if (!in_array(strtolower($db), $this->disabled)) { + $return[] = $db; + } + } + return $return; + } + +}