diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-12-13 15:15:14 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2016-12-19 11:59:48 +0100 |
commit | ed4017dfb4d605943988c6686b088b41d1680110 (patch) | |
tree | c50d57d247c46b20e514f10f3b381820c2578b4f /lib/private/Authentication | |
parent | 93003120461648140ee244b345cfcb6690071faa (diff) | |
download | nextcloud-server-ed4017dfb4d605943988c6686b088b41d1680110.tar.gz nextcloud-server-ed4017dfb4d605943988c6686b088b41d1680110.zip |
fix minor issues
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r-- | lib/private/Authentication/TwoFactorAuth/Manager.php | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php index 297e69fac99..1d0deada696 100644 --- a/lib/private/Authentication/TwoFactorAuth/Manager.php +++ b/lib/private/Authentication/TwoFactorAuth/Manager.php @@ -31,6 +31,7 @@ use OCP\Activity\IManager; use OCP\AppFramework\QueryException; use OCP\Authentication\TwoFactorAuth\IProvider; use OCP\IConfig; +use OCP\ILogger; use OCP\ISession; use OCP\IUser; @@ -53,16 +54,23 @@ class Manager { /** @var IManager */ private $activityManager; + /** @var ILogger */ + private $logger; + /** * @param AppManager $appManager * @param ISession $session * @param IConfig $config + * @param IManager $activityManager + * @param ILogger $logger */ - public function __construct(AppManager $appManager, ISession $session, IConfig $config, IManager $activityManager) { + public function __construct(AppManager $appManager, ISession $session, IConfig $config, IManager $activityManager, + ILogger $logger) { $this->appManager = $appManager; $this->session = $session; $this->config = $config; $this->activityManager = $activityManager; + $this->logger = $logger; } /** @@ -211,11 +219,16 @@ class Manager { private function publishEvent(IUser $user, $event, array $params) { $activity = $this->activityManager->generateEvent(); $activity->setApp('twofactor_generic') - ->setType('twofactor_generic') + ->setType('twofactor') ->setAuthor($user->getUID()) - ->setAffectedUser($user->getUID()); - $activity->setSubject($event, $params); - $this->activityManager->publish($activity); + ->setAffectedUser($user->getUID()) + ->setSubject($event, $params); + try { + $this->activityManager->publish($activity); + } catch (Exception $e) { + $this->logger->warning('could not publish backup code creation activity', ['app' => 'twofactor_backupcodes']); + $this->logger->logException($e, ['app' => 'twofactor_backupcodes']); + } } /** |