Emit OC\User::changeUser on change of display name

This commit is contained in:
Thomas Müller 2016-01-18 21:01:16 +01:00
parent f16ddef96a
commit 51b50bd260
1 changed files with 6 additions and 1 deletions

View File

@ -137,8 +137,13 @@ class User implements IUser {
public function setDisplayName($displayName) { public function setDisplayName($displayName) {
$displayName = trim($displayName); $displayName = trim($displayName);
if ($this->backend->implementsActions(\OC_User_Backend::SET_DISPLAYNAME) && !empty($displayName)) { if ($this->backend->implementsActions(\OC_User_Backend::SET_DISPLAYNAME) && !empty($displayName)) {
$this->displayName = $displayName;
$result = $this->backend->setDisplayName($this->uid, $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; return $result !== false;
} else { } else {
return false; return false;