/usr/share/adminer/plugins/login-servers.php is in adminer 4.6.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | <?php
/** Display constant list of servers in login form
* @link https://www.adminer.org/plugins/#use
* @author Jakub Vrana, https://www.vrana.cz/
* @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)
*/
class AdminerLoginServers {
/** @access protected */
var $servers, $driver;
/** Set supported servers
* @param array array($domain) or array($domain => $description) or array($category => array())
* @param string
*/
function __construct($servers, $driver = "server") {
$this->servers = $servers;
$this->driver = $driver;
}
function serverName($server) {
return h($this->servers[$server]);
}
function login($login, $password) {
// check if server is allowed
foreach ($this->servers as $key => $val) {
$servers = $val;
if (!is_array($val)) {
$servers = array($key => $val);
}
foreach ($servers as $k => $v) {
if ((is_string($k) ? $k : $v) == SERVER) {
return;
}
}
}
return false;
}
function loginForm() {
?>
<table cellspacing="0">
<tr><th><?php echo lang('Server'); ?><td><input type="hidden" name="auth[driver]" value="<?php echo $this->driver; ?>"><select name="auth[server]"><?php echo optionlist($this->servers, SERVER); ?></select>
<tr><th><?php echo lang('Username'); ?><td><input id="username" name="auth[username]" value="<?php echo h($_GET["username"]); ?>">
<tr><th><?php echo lang('Password'); ?><td><input type="password" name="auth[password]">
</table>
<p><input type="submit" value="<?php echo lang('Login'); ?>">
<?php
echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n";
return true;
}
}
|