diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-13 12:34:02 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-13 12:34:02 +0200 |
commit | 1110b51aa3c7627855d775e6122cb27553118944 (patch) | |
tree | ab33c1f8607279c3e6aee2f56c78baa631cc03fc /lib/private/User/User.php | |
parent | 0eb08a510b7393da0067750e01cdae8a4d1d009a (diff) | |
download | nextcloud-server-1110b51aa3c7627855d775e6122cb27553118944.tar.gz nextcloud-server-1110b51aa3c7627855d775e6122cb27553118944.zip |
Allow to read the old email on the hook as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/User/User.php')
-rw-r--r-- | lib/private/User/User.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index bca9c46bfd0..a3be0c24bb9 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -158,12 +158,13 @@ class User implements IUser { * @since 9.0.0 */ public function setEMailAddress($mailAddress) { + $oldMailAddress = $this->getEMailAddress(); if($mailAddress === '') { $this->config->deleteUserValue($this->uid, 'settings', 'email'); } else { $this->config->setUserValue($this->uid, 'settings', 'email', $mailAddress); } - $this->triggerChange('eMailAddress', $mailAddress); + $this->triggerChange('eMailAddress', $mailAddress, $oldMailAddress); } /** @@ -435,9 +436,9 @@ class User implements IUser { return $url; } - public function triggerChange($feature, $value = null) { + public function triggerChange($feature, $value = null, $oldValue = null) { if ($this->emitter) { - $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value)); + $this->emitter->emit('\OC\User', 'changeUser', array($this, $feature, $value, $oldValue)); } } } |