Bugfix: GetActionParam() failed

This commit is contained in:
the-djmaze 2023-04-11 13:57:28 +02:00
parent a889fc262a
commit 103b431780

View file

@ -7,8 +7,8 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
{ {
const const
NAME = 'Two Factor Authentication', NAME = 'Two Factor Authentication',
VERSION = '2.16.1', VERSION = '2.16.2',
RELEASE = '2022-09-20', RELEASE = '2023-04-11',
REQUIRED = '2.15.2', REQUIRED = '2.15.2',
CATEGORY = 'Login', CATEGORY = 'Login',
DESCRIPTION = 'Provides support for TOTP 2FA'; DESCRIPTION = 'Provides support for TOTP 2FA';
@ -167,10 +167,10 @@ class TwoFactorAuthPlugin extends \RainLoop\Plugins\AbstractPlugin
return $this->jsonResponse(__FUNCTION__, false); return $this->jsonResponse(__FUNCTION__, false);
} }
$oSettings = $this->Manager()->Actions()->SettingsProvider()->Load($oAccount); $oActions = $this->Manager()->Actions();
if ($this->Manager()->Actions()->HasActionParam('EnableTwoFactor')) { if ($oActions->HasActionParam('EnableTwoFactor')) {
$sValue = $this->GetActionParam('EnableTwoFactor', ''); $sValue = $oActions->GetActionParam('EnableTwoFactor', '');
$oSettings->SetConf('EnableTwoFactor', !empty($sValue)); $oActions->SettingsProvider()->Load($oAccount)->SetConf('EnableTwoFactor', !empty($sValue));
} }
$sEmail = $oAccount->Email(); $sEmail = $oAccount->Email();