Skip to content

Commit

Permalink
Merge #15749 - Fix #15351 - retain 2FA setting
Browse files Browse the repository at this point in the history
Pull-request: #15749
Fixes: #15351
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Jan 7, 2020
2 parents af100ab + 7e007f8 commit 21c1bb8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions prefs_forms.php
Expand Up @@ -14,6 +14,7 @@
use PhpMyAdmin\Relation;
use PhpMyAdmin\Response;
use PhpMyAdmin\Template;
use PhpMyAdmin\TwoFactor;
use PhpMyAdmin\Url;
use PhpMyAdmin\UserPreferences;
use PhpMyAdmin\UserPreferencesHeader;
Expand Down Expand Up @@ -59,8 +60,12 @@

$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();
Expand Down

0 comments on commit 21c1bb8

Please sign in to comment.