Update index.php
Disable the auto login if the default setting-> adminer -> auto_login is not set.
This commit is contained in:
+39
-38
@@ -23,47 +23,48 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function adminer_object() {
|
//auto login
|
||||||
|
if (isset($_SESSION['adminer']['auto_login']['boolean'])) {
|
||||||
|
function adminer_object() {
|
||||||
|
class AdminerSoftware extends Adminer {
|
||||||
|
|
||||||
class AdminerSoftware extends Adminer {
|
function name() {
|
||||||
|
// custom name in title and heading
|
||||||
|
return 'Adminer';
|
||||||
|
}
|
||||||
|
|
||||||
function name() {
|
function permanentLogin() {
|
||||||
// custom name in title and heading
|
// key used for permanent login
|
||||||
return 'Adminer';
|
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
||||||
|
return "7bebc76d8680196752c6b961ef13c360";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function credentials() {
|
||||||
|
// server, username and password for connecting to database
|
||||||
|
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
||||||
|
global $db_host, $db_username, $db_password;
|
||||||
|
return array($db_host.':'.$db_port, $db_username, $db_password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function database() {
|
||||||
|
// database name, will be escaped by Adminer
|
||||||
|
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
||||||
|
global $db_name;
|
||||||
|
return $db_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function login($login, $password) {
|
||||||
|
// validate user submitted credentials
|
||||||
|
return ($_SESSION['adminer']['auto_login']['boolean'] == 'true') ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return new AdminerSoftware;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function permanentLogin() {
|
|
||||||
// key used for permanent login
|
|
||||||
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
|
||||||
return "7bebc76d8680196752c6b961ef13c360";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function credentials() {
|
|
||||||
// server, username and password for connecting to database
|
|
||||||
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
|
||||||
global $db_host, $db_username, $db_password;
|
|
||||||
return array($db_host.':'.$db_port, $db_username, $db_password);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function database() {
|
|
||||||
// database name, will be escaped by Adminer
|
|
||||||
if ($_SESSION['adminer']['auto_login']['boolean'] == 'true') {
|
|
||||||
global $db_name;
|
|
||||||
return $db_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function login($login, $password) {
|
|
||||||
// validate user submitted credentials
|
|
||||||
return ($_SESSION['adminer']['auto_login']['boolean'] == 'true') ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return new AdminerSoftware;
|
|
||||||
}
|
|
||||||
|
|
||||||
// include original Adminer or Adminer Editor
|
// include original Adminer or Adminer Editor
|
||||||
include "adminer.php";
|
include "adminer.php";
|
||||||
|
|||||||
Reference in New Issue
Block a user