8
0

transfer profile and language selection through webauthn process

Dieser Commit ist enthalten in:
Daniel Seifert 2022-11-24 09:10:45 +01:00
Ursprung 26556eb889
Commit 9e0b92c9a9
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F
3 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -75,6 +75,10 @@ class d3webauthnadminlogin extends AdminController
$this->generateCredentialRequest();
$this->addTplParam('navFormParams', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS));
$this->addTplParam('currentProfile', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE));
$this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE);
$this->addTplParam('currentChLanguage', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE));
$this->d3GetSession()->deleteVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
return $this->d3CallMockableParent('render');
}
@ -114,7 +118,7 @@ class d3webauthnadminlogin extends AdminController
/** @var d3_User_Webauthn $user */
$user = $this->d3GetUserObject();
$userId = $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER);
$selectedProfile = $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE);
$selectedProfile = Registry::getRequest()->getRequestEscapedParameter('profile');
try {
$error = Registry::getRequest()->getRequestEscapedParameter('error');
@ -132,12 +136,9 @@ class d3webauthnadminlogin extends AdminController
$user->load($userId);
$session = $this->d3GetSession();
$adminProfiles = $session->getVariable("aAdminProfiles");
$selectedLanguage = $session->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
$session->initNewSession();
$session->setVariable("aAdminProfiles", $adminProfiles);
$session->setVariable(WebauthnConf::OXID_ADMIN_AUTH, $userId);
$session->setVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE, $selectedProfile);
$session->setVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE, $selectedLanguage);
$cookie = Registry::getUtilsServer()->getOxCookie();
if ($cookie === null) {

Datei anzeigen

@ -23,6 +23,8 @@
<input type="hidden" name="fnc" value="">
<input type="hidden" name="cl" value="login">
<input type="hidden" name="profile" value="[{$currentProfile}]">
<input type="hidden" name="chlanguage" value="[{$currentChLanguage}]">
[{if !empty($Errors.default)}]
[{include file="inc_error.tpl" Errorlist=$Errors.default}]

Datei anzeigen

@ -93,7 +93,7 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
public function d3webauthnAfterLogin()
{
$myUtilsServer = Registry::getUtilsServer();
$sProfile = Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE);
$sProfile = Registry::getRequest()->getRequestEscapedParameter('profile');
// #533
if (isset($sProfile)) {
@ -110,7 +110,7 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
}
// languages
$iLang = Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
$iLang = Registry::getRequest()->getRequestEscapedParameter('chlanguage');
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
if (!isset($aLanguages[$iLang])) {