set selected language for otp form
This commit is contained in:
parent
77eca02079
commit
a809c04b5b
@ -90,6 +90,10 @@ class d3totpadminlogin extends AdminController
|
|||||||
$this->addTplParam('selectedProfile', Registry::getRequest()->getRequestEscapedParameter('profile'));
|
$this->addTplParam('selectedProfile', Registry::getRequest()->getRequestEscapedParameter('profile'));
|
||||||
$this->addTplParam('selectedChLanguage', Registry::getRequest()->getRequestEscapedParameter('chlanguage'));
|
$this->addTplParam('selectedChLanguage', Registry::getRequest()->getRequestEscapedParameter('chlanguage'));
|
||||||
|
|
||||||
|
/** @var d3_totp_LoginController $loginController */
|
||||||
|
$loginController = oxNew(LoginController::class);
|
||||||
|
$loginController->d3totpAfterLoginSetLanguage();
|
||||||
|
|
||||||
return parent::render();
|
return parent::render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,13 +28,8 @@ class d3totplogin extends FrontendController
|
|||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
if (false == Registry::getSession()->hasVariable(d3totp_conf::SESSION_CURRENTUSER)) {
|
if (!Registry::getSession()->hasVariable(d3totp_conf::SESSION_CURRENTUSER)) {
|
||||||
$this->getUtils()->redirect('index.php?cl=start');
|
$this->getUtils()->redirect('index.php?cl=start');
|
||||||
if (false == defined('OXID_PHP_UNIT')) {
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
exit;
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addTplParam('navFormParams', Registry::getSession()->getVariable(d3totp_conf::SESSION_NAVFORMPARAMS));
|
$this->addTplParam('navFormParams', Registry::getSession()->getVariable(d3totp_conf::SESSION_NAVFORMPARAMS));
|
||||||
|
@ -82,7 +82,13 @@ class d3_totp_LoginController extends d3_totp_LoginController_parent
|
|||||||
$myUtilsServer->setOxCookie("oxidadminprofile", "", time() - 3600, "/");
|
$myUtilsServer->setOxCookie("oxidadminprofile", "", time() - 3600, "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
// languages
|
$this->d3totpAfterLoginSetLanguage();
|
||||||
|
Registry::getSession()->deleteVariable(d3totp_conf::SESSION_ADMIN_CHLANGUAGE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function d3totpAfterLoginSetLanguage()
|
||||||
|
{
|
||||||
|
$myUtilsServer = Registry::getUtilsServer();
|
||||||
$iLang = Registry::getSession()->getVariable(d3totp_conf::SESSION_ADMIN_CHLANGUAGE);
|
$iLang = Registry::getSession()->getVariable(d3totp_conf::SESSION_ADMIN_CHLANGUAGE);
|
||||||
|
|
||||||
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
$aLanguages = Registry::getLang()->getAdminTplLanguageArray();
|
||||||
@ -92,7 +98,6 @@ class d3_totp_LoginController extends d3_totp_LoginController_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(d3totp_conf::SESSION_ADMIN_CHLANGUAGE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,21 +47,11 @@ class d3_totp_utils extends d3_totp_utils_parent
|
|||||||
&& $totp->isActive() === false
|
&& $totp->isActive() === false
|
||||||
) {
|
) {
|
||||||
$this->redirect('index.php?cl=d3force_2fa');
|
$this->redirect('index.php?cl=d3force_2fa');
|
||||||
if (false == defined('OXID_PHP_UNIT')) {
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
exit;
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//staten der prüfung vom einmalpasswort
|
//staten der prüfung vom einmalpasswort
|
||||||
if ($blAuth && $totp->isActive() && false === $totpAuth) {
|
if ($blAuth && $totp->isActive() && false === $totpAuth) {
|
||||||
$this->redirect('index.php?cl=d3totpadminlogin');
|
$this->redirect('index.php?cl=d3totpadminlogin');
|
||||||
if (false == defined('OXID_PHP_UNIT')) {
|
|
||||||
// @codeCoverageIgnoreStart
|
|
||||||
exit;
|
|
||||||
// @codeCoverageIgnoreEnd
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $blAuth;
|
return $blAuth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user