This answer applies to admin version 4.2.5. Unfortunately, it is not valid for Adminer 4.3.x.
You need to override the methods loginand databasesclass Adminer, making sure that you do this only for the SQLite driver, and not in other cases. The following code provides a basic login system with a list of databases:
<?php
function adminer_object() {
class AdminerSoftware extends Adminer {
function login($login, $password) {
global $jush;
if ($jush == "sqlite")
return ($login === 'admin') && ($password === 'changeme');
return true;
}
function databases($flush = true) {
if (isset($_GET['sqlite']))
return ["/path/to/first.db", "/path/to/second.db"];
return get_databases($flush);
}
}
return new AdminerSoftware;
}
include "./adminer-4.2.5.php";
The code can be adapted to support multiple users. Save the file as index.phpin the same directory as it is adminer-4.2.5.php. Be sure to configure the username, password, and database paths.
Here are some important notes:
- the method is
loginincorrectly named, this is the initial check performed by the administrator - , , . MySQL,
true - SQLite ,
