Fix #15724 - Fix 2FA disabled
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
62f068d048
commit
6c35ea3be7
@ -1555,13 +1555,33 @@ class DatabaseInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function checks and initialises the phpMyAdmin configuration
|
||||
* storage state before it is used into session cache.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initRelationParamsCache()
|
||||
{
|
||||
if (strlen($GLOBALS['db'])) {
|
||||
$cfgRelation = $this->relation->getRelationsParam();
|
||||
if (empty($cfgRelation['db'])) {
|
||||
$this->relation->fixPmaTables($GLOBALS['db'], false);
|
||||
}
|
||||
}
|
||||
$cfgRelation = $this->relation->getRelationsParam();
|
||||
if (empty($cfgRelation['db'])) {
|
||||
if ($GLOBALS['dblist']->databases->exists('phpmyadmin')) {
|
||||
$this->relation->fixPmaTables('phpmyadmin', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called just after a connection to the MySQL database server has
|
||||
* been established. It sets the connection collation, and determines the
|
||||
* version of MySQL which is running.
|
||||
*
|
||||
* @param integer $link link type
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postConnectControl()
|
||||
@ -1573,18 +1593,7 @@ class DatabaseInterface
|
||||
*/
|
||||
$GLOBALS['dblist'] = new DatabaseList();
|
||||
|
||||
if (strlen($GLOBALS['db'])) {
|
||||
$cfgRelation = $this->relation->getRelationsParam();
|
||||
if (empty($cfgRelation['db'])) {
|
||||
$this->relation->fixPmaTables($GLOBALS['db'], false);
|
||||
}
|
||||
}
|
||||
$cfgRelation = $this->relation->getRelationsParam();
|
||||
if (empty($cfgRelation['db'])) {
|
||||
if ($GLOBALS['dblist']->databases->exists('phpmyadmin')) {
|
||||
$this->relation->fixPmaTables('phpmyadmin', false);
|
||||
}
|
||||
}
|
||||
$this->initRelationParamsCache();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,10 @@ class TwoFactor
|
||||
*/
|
||||
public function __construct($user)
|
||||
{
|
||||
/** @var DatabaseInterface $dbi */
|
||||
global $dbi;
|
||||
$dbi->initRelationParamsCache();
|
||||
|
||||
$this->userPreferences = new UserPreferences();
|
||||
$this->user = $user;
|
||||
$this->_available = $this->getAvailable();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user