relation->getRelationParameters(); $this->render('preferences/header', [ 'route' => $request->getRoute(), 'is_saved' => $request->hasQueryParam('saved'), 'has_config_storage' => $relationParameters->userPreferencesFeature !== null, ]); $twoFactor = new TwoFactor($GLOBALS['cfg']['Server']['user']); if ($request->hasBodyParam('2fa_remove')) { if (! $twoFactor->check(true)) { $this->render('preferences/two_factor/confirm', ['form' => $twoFactor->render()]); return; } $twoFactor->configure(''); $this->response->addHTML( Message::rawNotice(__('Two-factor authentication has been removed.'))->getDisplay(), ); } elseif ($request->hasBodyParam('2fa_configure')) { if (! $twoFactor->configure($request->getParsedBodyParam('2fa_configure'))) { $this->render('preferences/two_factor/configure', [ 'form' => $twoFactor->setup(), 'configure' => $request->getParsedBodyParam('2fa_configure'), ]); return; } $this->response->addHTML( Message::rawNotice(__('Two-factor authentication has been configured.'))->getDisplay(), ); } $backend = $twoFactor->getBackend(); $this->render('preferences/two_factor/main', [ 'enabled' => $twoFactor->isWritable(), 'num_backends' => count($twoFactor->getAvailable()), 'backend_id' => $backend::$id, 'backend_name' => $backend::getName(), 'backend_description' => $backend::getDescription(), 'backends' => $twoFactor->getAllBackends(), 'missing' => $twoFactor->getMissingDeps(), ]); if ($request->isAjax()) { $this->response->addJSON('disableNaviSettings', true); } else { define('PMA_DISABLE_NAVI_SETTINGS', true); } } }