From 9e7fcdf32c90e96ae722e86d2aa7a6a618becb7a Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 23 Feb 2012 22:56:03 -0800 Subject: [PATCH] Plugin to hide databases --- adminer/plugin.php | 1 + plugins/database-hide.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 plugins/database-hide.php 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; + } + +} -- 2.39.5