diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-08-14 17:06:57 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-08-14 17:25:46 +0200 |
commit | 6f24865bf8a55975778acca5e2610fda51deca35 (patch) | |
tree | 90a3280db4a542d3f5b12f2bc66292c1ae45f3e2 | |
parent | d05c815796152f0d76c459e893f154b3b78005aa (diff) | |
download | nextcloud-server-6f24865bf8a55975778acca5e2610fda51deca35.tar.gz nextcloud-server-6f24865bf8a55975778acca5e2610fda51deca35.zip |
don't blame email address changers
the information is being collected with admin_audit
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | apps/admin_audit/lib/Actions/UserManagement.php | 27 | ||||
-rw-r--r-- | settings/Hooks.php | 13 |
2 files changed, 24 insertions, 16 deletions
diff --git a/apps/admin_audit/lib/Actions/UserManagement.php b/apps/admin_audit/lib/Actions/UserManagement.php index 5cf1494df6e..1ad6ba4e20f 100644 --- a/apps/admin_audit/lib/Actions/UserManagement.php +++ b/apps/admin_audit/lib/Actions/UserManagement.php @@ -97,14 +97,25 @@ class UserManagement extends Action { * @param array $params */ public function change(array $params) { - if ($params['feature'] === 'enabled') { - $this->log( - $params['value'] === 'true' ? 'User enabled: "%s"' : 'User disabled: "%s"', - ['user' => $params['user']->getUID()], - [ - 'user', - ] - ); + switch($params['feature']) { + case 'enabled': + $this->log( + $params['value'] === 'true' ? 'User enabled: "%s"' : 'User disabled: "%s"', + ['user' => $params['user']->getUID()], + [ + 'user', + ] + ); + break; + case 'eMailAddress': + $this->log( + 'Email address changed for user %s', + ['user' => $params['user']->getUID()], + [ + 'user', + ] + ); + break; } } diff --git a/settings/Hooks.php b/settings/Hooks.php index 097d708a36a..f2b9e4fd086 100644 --- a/settings/Hooks.php +++ b/settings/Hooks.php @@ -165,6 +165,7 @@ class Hooks { $actor = $this->userSession->getUser(); if ($actor instanceof IUser) { + $subject = Provider::EMAIL_CHANGED_SELF; if ($actor->getUID() !== $user->getUID()) { $this->l = $this->languageFactory->get( 'settings', @@ -173,15 +174,11 @@ class Hooks { $this->config->getSystemValue('default_language', 'en') ) ); - - $text = $this->l->t('%1$s changed your email address on %2$s.', [$actor->getDisplayName(), $instanceUrl]); - $event->setAuthor($actor->getUID()) - ->setSubject(Provider::EMAIL_CHANGED_BY, [$actor->getUID()]); - } else { - $text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]); - $event->setAuthor($actor->getUID()) - ->setSubject(Provider::EMAIL_CHANGED_SELF); + $subject = Provider::EMAIL_CHANGED; } + $text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]); + $event->setAuthor($actor->getUID()) + ->setSubject($subject); } else { $text = $this->l->t('Your email address on %s was changed by an administrator.', [$instanceUrl]); $event->setSubject(Provider::EMAIL_CHANGED); |