summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/twofactor_backupcodes/appinfo/info.xml7
-rw-r--r--lib/private/Authentication/TwoFactorAuth/Manager.php11
-rw-r--r--settings/Activity/SecurityFilter.php (renamed from apps/twofactor_backupcodes/lib/Activity/GenericFilter.php)10
-rw-r--r--settings/Activity/SecurityProvider.php (renamed from apps/twofactor_backupcodes/lib/Activity/GenericProvider.php)6
-rw-r--r--settings/Activity/SecuritySetting.php (renamed from apps/twofactor_backupcodes/lib/Activity/GenericSetting.php)8
-rw-r--r--settings/Application.php6
6 files changed, 24 insertions, 24 deletions
diff --git a/apps/twofactor_backupcodes/appinfo/info.xml b/apps/twofactor_backupcodes/appinfo/info.xml
index e5e96eddcf9..77ecbd8e1a2 100644
--- a/apps/twofactor_backupcodes/appinfo/info.xml
+++ b/apps/twofactor_backupcodes/appinfo/info.xml
@@ -18,14 +18,7 @@
</dependencies>
<activity>
- <filters>
- <filter>OCA\TwoFactorBackupCodes\Activity\GenericFilter</filter>
- </filters>
- <settings>
- <setting>OCA\TwoFactorBackupCodes\Activity\GenericSetting</setting>
- </settings>
<providers>
- <provider>OCA\TwoFactorBackupCodes\Activity\GenericProvider</provider>
<provider>OCA\TwoFactorBackupCodes\Activity\Provider</provider>
</providers>
</activity>
diff --git a/lib/private/Authentication/TwoFactorAuth/Manager.php b/lib/private/Authentication/TwoFactorAuth/Manager.php
index 1d0deada696..06aa0224ae0 100644
--- a/lib/private/Authentication/TwoFactorAuth/Manager.php
+++ b/lib/private/Authentication/TwoFactorAuth/Manager.php
@@ -23,6 +23,7 @@
namespace OC\Authentication\TwoFactorAuth;
+use BadMethodCallException;
use Exception;
use OC;
use OC\App\AppManager;
@@ -218,16 +219,16 @@ class Manager {
*/
private function publishEvent(IUser $user, $event, array $params) {
$activity = $this->activityManager->generateEvent();
- $activity->setApp('twofactor_generic')
- ->setType('twofactor')
+ $activity->setApp('core')
+ ->setType('security')
->setAuthor($user->getUID())
->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']);
+ } catch (BadMethodCallException $e) {
+ $this->logger->warning('could not publish backup code creation activity', ['app' => 'core']);
+ $this->logger->logException($e, ['app' => 'core']);
}
}
diff --git a/apps/twofactor_backupcodes/lib/Activity/GenericFilter.php b/settings/Activity/SecurityFilter.php
index 27c0274b600..6bf36a9e488 100644
--- a/apps/twofactor_backupcodes/lib/Activity/GenericFilter.php
+++ b/settings/Activity/SecurityFilter.php
@@ -20,13 +20,13 @@
*
*/
-namespace OCA\TwoFactorBackupCodes\Activity;
+namespace OC\Settings\Activity;
use OCP\Activity\IFilter;
use OCP\IL10N;
use OCP\IURLGenerator;
-class GenericFilter implements IFilter {
+class SecurityFilter implements IFilter {
/** @var IURLGenerator */
private $urlGenerator;
@@ -44,7 +44,7 @@ class GenericFilter implements IFilter {
}
public function filterTypes(array $types) {
- return array_intersect(['twofactor'], $types);
+ return array_intersect(['security'], $types);
}
public function getIcon() {
@@ -52,11 +52,11 @@ class GenericFilter implements IFilter {
}
public function getIdentifier() {
- return 'twofactor';
+ return 'security';
}
public function getName() {
- return $this->l10n->t('Two-factor authentication');
+ return $this->l10n->t('Security');
}
public function getPriority() {
diff --git a/apps/twofactor_backupcodes/lib/Activity/GenericProvider.php b/settings/Activity/SecurityProvider.php
index ffdd47708d5..74747f684da 100644
--- a/apps/twofactor_backupcodes/lib/Activity/GenericProvider.php
+++ b/settings/Activity/SecurityProvider.php
@@ -20,7 +20,7 @@
*
*/
-namespace OCA\TwoFactorBackupCodes\Activity;
+namespace OC\Settings\Activity;
use InvalidArgumentException;
use OCP\Activity\IEvent;
@@ -29,7 +29,7 @@ use OCP\ILogger;
use OCP\IURLGenerator;
use OCP\L10N\IFactory as L10nFactory;
-class GenericProvider implements IProvider {
+class SecurityProvider implements IProvider {
/** @var L10nFactory */
private $l10n;
@@ -47,7 +47,7 @@ class GenericProvider implements IProvider {
}
public function parse($language, IEvent $event, IEvent $previousEvent = null) {
- if ($event->getType() !== 'twofactor') {
+ if ($event->getType() !== 'security') {
throw new InvalidArgumentException();
}
diff --git a/apps/twofactor_backupcodes/lib/Activity/GenericSetting.php b/settings/Activity/SecuritySetting.php
index abd1c60f1d5..fe1b0dd8f57 100644
--- a/apps/twofactor_backupcodes/lib/Activity/GenericSetting.php
+++ b/settings/Activity/SecuritySetting.php
@@ -20,12 +20,12 @@
*
*/
-namespace OCA\TwoFactorBackupCodes\Activity;
+namespace OC\Settings\Activity;
use OCP\Activity\ISetting;
use OCP\IL10N;
-class GenericSetting implements ISetting {
+class SecuritySetting implements ISetting {
/** @var IL10N */
private $l10n;
@@ -43,11 +43,11 @@ class GenericSetting implements ISetting {
}
public function getIdentifier() {
- return 'twofactor';
+ return 'security';
}
public function getName() {
- return $this->l10n->t('Two-factor authentication');
+ return $this->l10n->t('Security');
}
public function getPriority() {
diff --git a/settings/Application.php b/settings/Application.php
index 0ca2d28dfe6..f79453e3d01 100644
--- a/settings/Application.php
+++ b/settings/Application.php
@@ -34,6 +34,9 @@ use OC\AppFramework\Utility\TimeFactory;
use OC\Authentication\Token\IProvider;
use OC\Server;
use OC\Settings\Activity\Provider;
+use OC\Settings\Activity\SecurityFilter;
+use OC\Settings\Activity\SecurityProvider;
+use OC\Settings\Activity\SecuritySetting;
use OC\Settings\Activity\Setting;
use OC\Settings\Mailer\NewUserMailHelper;
use OC\Settings\Middleware\SubadminMiddleware;
@@ -114,6 +117,9 @@ class Application extends App {
$activityManager = $this->getContainer()->getServer()->getActivityManager();
$activityManager->registerSetting(Setting::class); // FIXME move to info.xml
$activityManager->registerProvider(Provider::class); // FIXME move to info.xml
+ $activityManager->registerFilter(SecurityFilter::class); // FIXME move to info.xml
+ $activityManager->registerSetting(SecuritySetting::class); // FIXME move to info.xml
+ $activityManager->registerProvider(SecurityProvider::class); // FIXME move to info.xml
Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword');
Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo');