transfer profile and language selection through webauthn process
This commit is contained in:
parent
26556eb889
commit
9e0b92c9a9
|
@ -75,6 +75,10 @@ class d3webauthnadminlogin extends AdminController
|
||||||
$this->generateCredentialRequest();
|
$this->generateCredentialRequest();
|
||||||
|
|
||||||
$this->addTplParam('navFormParams', $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_SESSION_NAVFORMPARAMS));
|
$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');
|
return $this->d3CallMockableParent('render');
|
||||||
}
|
}
|
||||||
|
@ -114,7 +118,7 @@ class d3webauthnadminlogin extends AdminController
|
||||||
/** @var d3_User_Webauthn $user */
|
/** @var d3_User_Webauthn $user */
|
||||||
$user = $this->d3GetUserObject();
|
$user = $this->d3GetUserObject();
|
||||||
$userId = $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER);
|
$userId = $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_SESSION_CURRENTUSER);
|
||||||
$selectedProfile = $this->d3GetSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE);
|
$selectedProfile = Registry::getRequest()->getRequestEscapedParameter('profile');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$error = Registry::getRequest()->getRequestEscapedParameter('error');
|
$error = Registry::getRequest()->getRequestEscapedParameter('error');
|
||||||
|
@ -132,12 +136,9 @@ class d3webauthnadminlogin extends AdminController
|
||||||
$user->load($userId);
|
$user->load($userId);
|
||||||
$session = $this->d3GetSession();
|
$session = $this->d3GetSession();
|
||||||
$adminProfiles = $session->getVariable("aAdminProfiles");
|
$adminProfiles = $session->getVariable("aAdminProfiles");
|
||||||
$selectedLanguage = $session->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
|
|
||||||
$session->initNewSession();
|
$session->initNewSession();
|
||||||
$session->setVariable("aAdminProfiles", $adminProfiles);
|
$session->setVariable("aAdminProfiles", $adminProfiles);
|
||||||
$session->setVariable(WebauthnConf::OXID_ADMIN_AUTH, $userId);
|
$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();
|
$cookie = Registry::getUtilsServer()->getOxCookie();
|
||||||
if ($cookie === null) {
|
if ($cookie === null) {
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
<input type="hidden" name="fnc" value="">
|
<input type="hidden" name="fnc" value="">
|
||||||
<input type="hidden" name="cl" value="login">
|
<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)}]
|
[{if !empty($Errors.default)}]
|
||||||
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
|
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
|
||||||
|
|
|
@ -93,7 +93,7 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
|
||||||
public function d3webauthnAfterLogin()
|
public function d3webauthnAfterLogin()
|
||||||
{
|
{
|
||||||
$myUtilsServer = Registry::getUtilsServer();
|
$myUtilsServer = Registry::getUtilsServer();
|
||||||
$sProfile = Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_PROFILE);
|
$sProfile = Registry::getRequest()->getRequestEscapedParameter('profile');
|
||||||
|
|
||||||
// #533
|
// #533
|
||||||
if (isset($sProfile)) {
|
if (isset($sProfile)) {
|
||||||
|
@ -110,7 +110,7 @@ class d3_LoginController_Webauthn extends d3_LoginController_Webauthn_parent
|
||||||
}
|
}
|
||||||
|
|
||||||
// languages
|
// languages
|
||||||
$iLang = Registry::getSession()->getVariable(WebauthnConf::WEBAUTHN_ADMIN_CHLANGUAGE);
|
$iLang = Registry::getRequest()->getRequestEscapedParameter('chlanguage');
|
||||||
|
|
||||||
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
||||||
if (!isset($aLanguages[$iLang])) {
|
if (!isset($aLanguages[$iLang])) {
|
||||||
|
|
Loading…
Reference in New Issue