Fix #15351 - retain 2FA setting

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
This commit is contained in:
Jayati Shrivastava 2020-01-07 21:05:47 +01:00 committed by William Desportes
parent af100abddf
commit 7e007f8b7c
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -14,6 +14,7 @@ use PhpMyAdmin\Core;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
use PhpMyAdmin\TwoFactor;
use PhpMyAdmin\Url;
use PhpMyAdmin\UserPreferences;
use PhpMyAdmin\UserPreferencesHeader;
@ -59,8 +60,12 @@ if (isset($_POST['revert'])) {
$error = null;
if ($form_display->process(false) && ! $form_display->hasErrors()) {
// Load 2FA settings
$twoFactor = new TwoFactor($GLOBALS['cfg']['Server']['user']);
// save settings
$result = $userPreferences->save($cf->getConfigArray());
// save back the 2FA setting only
$twoFactor->save();
if ($result === true) {
// reload config
$GLOBALS['PMA_Config']->loadUserPreferences();