From: Jakub Vrana Date: Fri, 24 Feb 2012 06:56:03 +0000 (-0800) Subject: Plugin to hide databases X-Git-Tag: v3.3.4~16 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=9e7fcdf32c90e96ae722e86d2aa7a6a618becb7a;p=adminer.git Plugin to hide databases --- 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; + } + +}