set selected language for webauthn form
This commit is contained in:
parent
9e0b92c9a9
commit
a80d5dcde5
@ -65,13 +65,12 @@ class d3webauthnadminlogin extends AdminController
|
|||||||
!$this->d3GetSession()->hasVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER)
|
!$this->d3GetSession()->hasVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER)
|
||||||
) {
|
) {
|
||||||
$this->getUtils()->redirect('index.php?cl=admin_start');
|
$this->getUtils()->redirect('index.php?cl=admin_start');
|
||||||
if (!defined('OXID_PHP_UNIT')) {
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
exit;
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @var d3_LoginController_Webauthn $loginController */
|
||||||
|
$loginController = oxNew(LoginController::class);
|
||||||
|
$loginController->d3WebauthnAfterLoginChangeLanguage();
|
||||||
|
|
||||||
$this->generateCredentialRequest();
|
$this->generateCredentialRequest();
|
||||||
|
|
||||||
$this->addTplParam('navFormParams', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS));
|
$this->addTplParam('navFormParams', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS));
|
||||||
|
@ -21,4 +21,6 @@
|
|||||||
<input type="hidden" name="fnc" value="d3AssertAuthn">
|
<input type="hidden" name="fnc" value="d3AssertAuthn">
|
||||||
<input type="hidden" name="credential" value=''>
|
<input type="hidden" name="credential" value=''>
|
||||||
<input type="hidden" name="error" value=''>
|
<input type="hidden" name="error" value=''>
|
||||||
|
<input type="hidden" name="profile" value="[{$currentProfile}]">
|
||||||
|
<input type="hidden" name="chlanguage" value="[{$currentChLanguage}]">
|
||||||
</form>
|
</form>
|
||||||
|
@ -109,8 +109,16 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
|
|||||||
$myUtilsServer->setOxCookie("oxidadminprofile", "", time() - 3600, "/");
|
$myUtilsServer->setOxCookie("oxidadminprofile", "", time() - 3600, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->d3WebauthnAfterLoginChangeLanguage();
|
||||||
|
Registry::getSession()->deleteVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function d3WebauthnAfterLoginChangeLanguage()
|
||||||
|
{
|
||||||
|
$myUtilsServer = Registry::getUtilsServer();
|
||||||
// languages
|
// languages
|
||||||
$iLang = Registry::getRequest()->getRequestEscapedParameter('chlanguage');
|
$iLang = Registry::getRequest()->getRequestEscapedParameter('chlanguage') ?:
|
||||||
|
Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
|
||||||
|
|
||||||
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
||||||
if (!isset($aLanguages[$iLang])) {
|
if (!isset($aLanguages[$iLang])) {
|
||||||
@ -119,7 +127,6 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
|
|||||||
|
|
||||||
$myUtilsServer->setOxCookie("oxidadminlanguage", $aLanguages[$iLang]->abbr, time() + 31536000, "/");
|
$myUtilsServer->setOxCookie("oxidadminlanguage", $aLanguages[$iLang]->abbr, time() + 31536000, "/");
|
||||||
Registry::getLang()->setTplLanguage($iLang);
|
Registry::getLang()->setTplLanguage($iLang);
|
||||||
Registry::getSession()->deleteVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user