diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-18 21:01:16 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-20 14:57:20 +0100 |
commit | 51b50bd26049eed0d4335ae5f5282f53df0189a1 (patch) | |
tree | e1ad138629d275203135f42dcb2e3ecc38e71211 /lib/private/user | |
parent | f16ddef96a0446fdd6f8e926f75055cebc1f20cf (diff) | |
download | nextcloud-server-51b50bd26049eed0d4335ae5f5282f53df0189a1.tar.gz nextcloud-server-51b50bd26049eed0d4335ae5f5282f53df0189a1.zip |
Emit OC\User::changeUser on change of display name
Diffstat (limited to 'lib/private/user')
-rw-r--r-- | lib/private/user/user.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/user/user.php b/lib/private/user/user.php index d8a888806e0..5b8bb6947a5 100644 --- a/lib/private/user/user.php +++ b/lib/private/user/user.php @@ -137,8 +137,13 @@ class User implements IUser { public function setDisplayName($displayName) { $displayName = trim($displayName); if ($this->backend->implementsActions(\OC_User_Backend::SET_DISPLAYNAME) && !empty($displayName)) { - $this->displayName = $displayName; $result = $this->backend->setDisplayName($this->uid, $displayName); + if ($result) { + $this->displayName = $displayName; + if ($this->emitter) { + $this->emitter->emit('\OC\User', 'changeUser', array($this)); + } + } return $result !== false; } else { return false; |