diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-01-12 17:48:27 +0100 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-01-30 19:10:53 +0100 |
commit | f24fa2051d7c2866ced8cfe26bf147b3ce031082 (patch) | |
tree | 8880c43b83baf2b34741fb24f063afad216dc23d /settings/Activity | |
parent | be6475784ae39880ce4d2f338bcd8f40c2a4b082 (diff) | |
download | nextcloud-server-f24fa2051d7c2866ced8cfe26bf147b3ce031082.tar.gz nextcloud-server-f24fa2051d7c2866ced8cfe26bf147b3ce031082.zip |
Publish event for app token create/update/delete
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'settings/Activity')
-rw-r--r-- | settings/Activity/Provider.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/settings/Activity/Provider.php b/settings/Activity/Provider.php index e71a33e0d4f..1c5db89ec5c 100644 --- a/settings/Activity/Provider.php +++ b/settings/Activity/Provider.php @@ -40,6 +40,9 @@ class Provider implements IProvider { const EMAIL_CHANGED_BY = 'email_changed_by'; const EMAIL_CHANGED_SELF = 'email_changed_self'; const EMAIL_CHANGED = 'email_changed'; + public const APP_TOKEN_CREATED = 'app_token_created'; + public const APP_TOKEN_UPDATED = 'app_token_updated'; + public const APP_TOKEN_DELETED = 'app_token_deleted'; /** @var IFactory */ protected $languageFactory; @@ -107,6 +110,13 @@ class Provider implements IProvider { } else if ($event->getSubject() === self::EMAIL_CHANGED) { $subject = $this->l->t('Your email address was changed by an administrator'); + } else if ($event->getSubject() === self::APP_TOKEN_CREATED) { + $subject = $this->l->t('You created app password "%1$s"', $event->getSubjectParameters()); + } else if ($event->getSubject() === self::APP_TOKEN_UPDATED) { + $subject = $this->l->t('You updated app password "%1$s"', $event->getSubjectParameters()); + } else if ($event->getSubject() === self::APP_TOKEN_DELETED) { + $subject = $this->l->t('You deleted an app token'); + } else { throw new \InvalidArgumentException(); } @@ -131,6 +141,9 @@ class Provider implements IProvider { case self::PASSWORD_RESET: case self::EMAIL_CHANGED_SELF: case self::EMAIL_CHANGED: + case self::APP_TOKEN_CREATED: + case self::APP_TOKEN_UPDATED: + case self::APP_TOKEN_DELETED: return []; case self::PASSWORD_CHANGED_BY: case self::EMAIL_CHANGED_BY: |