2012-02-23 22:56:03 -08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
/** Hide some databases from the interface - just to improve design, not a security plugin
|
2015-09-08 09:23:25 -07:00
|
|
|
|
* @link https://www.adminer.org/plugins/#use
|
2017-02-27 13:43:33 +01:00
|
|
|
|
* @author Jakub Vrana, https://www.vrana.cz/
|
2018-01-14 11:03:54 +01:00
|
|
|
|
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
|
|
|
|
|
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
2012-02-23 22:56:03 -08:00
|
|
|
|
*/
|
2025-04-07 16:32:57 +02:00
|
|
|
|
class AdminerDatabaseHide extends Adminer\Plugin {
|
2012-02-23 22:56:03 -08:00
|
|
|
|
protected $disabled;
|
2025-02-21 13:53:18 +01:00
|
|
|
|
|
2012-02-23 22:56:03 -08:00
|
|
|
|
/**
|
2025-03-28 07:06:34 +01:00
|
|
|
|
* @param list<string> $disabled case insensitive database names in values
|
2012-02-23 22:56:03 -08:00
|
|
|
|
*/
|
2025-03-28 08:23:20 +01:00
|
|
|
|
function __construct(array $disabled) {
|
2012-02-23 22:56:03 -08:00
|
|
|
|
$this->disabled = array_map('strtolower', $disabled);
|
|
|
|
|
|
}
|
2025-02-21 13:53:18 +01:00
|
|
|
|
|
2012-02-23 22:56:03 -08:00
|
|
|
|
function databases($flush = true) {
|
|
|
|
|
|
$return = array();
|
2025-03-05 15:42:48 +01:00
|
|
|
|
foreach (Adminer\get_databases($flush) as $db) {
|
2012-02-23 22:56:03 -08:00
|
|
|
|
if (!in_array(strtolower($db), $this->disabled)) {
|
|
|
|
|
|
$return[] = $db;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return $return;
|
|
|
|
|
|
}
|
2025-04-07 17:00:59 +02:00
|
|
|
|
|
2025-04-08 12:57:03 +02:00
|
|
|
|
protected $translations = array(
|
2025-04-07 17:00:59 +02:00
|
|
|
|
'cs' => array('' => 'Skryje některé databáze z rozhraní – pouze vylepší vzhled, nikoliv bezpečnost'),
|
|
|
|
|
|
'de' => array('' => 'Verstecken Sie einige Datenbanken vor der Benutzeroberfläche – nur um das Design zu verbessern, verbessert nicht die Sicherheit.'),
|
|
|
|
|
|
'pl' => array('' => 'Ukryj niektóre bazy danych w interfejsie – tylko po to, aby ulepszyć motyw, a nie wtyczkę zabezpieczającą'),
|
|
|
|
|
|
'ro' => array('' => 'Ascundeți unele baze de date din interfață - doar pentru a îmbunătăți designul, nu un plugin de securitate'),
|
2025-04-08 19:34:12 +09:00
|
|
|
|
'ja' => array('' => '一部データベースを UI 上で表示禁止 (デザイン的な効果のみでセキュリティ的には効果なし)'),
|
2025-04-07 17:00:59 +02:00
|
|
|
|
);
|
2012-02-23 22:56:03 -08:00
|
|
|
|
}
|