From 57416b6a8408cd7f6b9df942e8c54a9bd4255739 Mon Sep 17 00:00:00 2001 From: nuxsmin Date: Thu, 2 Mar 2017 15:59:50 +0100 Subject: [PATCH] * [FIX] Fixed issue when retrieveing Authenticator plugin data for the current user. Closes #442. Thanks to @fellsho, @st3reo and @HellChords for the feedback --- inc/Plugins/Authenticator/ActionController.class.php | 1 - inc/Plugins/Authenticator/PreferencesController.class.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/Plugins/Authenticator/ActionController.class.php b/inc/Plugins/Authenticator/ActionController.class.php index 7b40ea815..a73766edb 100644 --- a/inc/Plugins/Authenticator/ActionController.class.php +++ b/inc/Plugins/Authenticator/ActionController.class.php @@ -26,7 +26,6 @@ use SP\Controller\ItemControllerInterface; use SP\Controller\RequestControllerTrait; -use SP\Core\ActionsInterface; use SP\Core\Plugin\PluginDataStore; use SP\Core\Session as CoreSession; use SP\DataModel\PluginData; diff --git a/inc/Plugins/Authenticator/PreferencesController.class.php b/inc/Plugins/Authenticator/PreferencesController.class.php index 8122dc251..07fd0c2b2 100644 --- a/inc/Plugins/Authenticator/PreferencesController.class.php +++ b/inc/Plugins/Authenticator/PreferencesController.class.php @@ -82,12 +82,12 @@ public function getSecurityTab() if (!$AuthenticatorData->isTwofaEnabled()) { $IV = Util::generateRandomBytes(); $AuthenticatorData->setIV($IV); - - Session::setUserData($AuthenticatorData); } else { $IV = $AuthenticatorData->getIV(); } + Session::setUserData($AuthenticatorData); + $twoFa = new Authenticator($UserData->getUserId(), $UserData->getUserLogin(), $IV); $this->Controller->view->assign('qrCode', !$AuthenticatorData->isTwofaEnabled() ? $twoFa->getUserQRCode() : '');