aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-04-11 12:50:15 +0200
committerGitHub <noreply@github.com>2019-04-11 12:50:15 +0200
commit3308c4092269b39c5038fc61075a61302a28a79c (patch)
tree1d47b607d16da5f1b26d825a1fbae60d00e8ad34 /lib/private
parentccabc63a09ee78913db682ac59bfba5512ace442 (diff)
parentc1e6a5965e517acdff9b2c72cf9dd0febdf801f5 (diff)
downloadnextcloud-server-3308c4092269b39c5038fc61075a61302a28a79c.tar.gz
nextcloud-server-3308c4092269b39c5038fc61075a61302a28a79c.zip
Merge pull request #14967 from nextcloud/lib-private-user-trigger-pass-old
Do not issue update command if nothing has changed in user values
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/User/User.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 48c913db2a9..12af787a5a6 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -138,11 +138,12 @@ class User implements IUser {
*/
public function setDisplayName($displayName) {
$displayName = trim($displayName);
- if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName)) {
+ $oldDisplayName = $this->getDisplayName();
+ if ($this->backend->implementsActions(Backend::SET_DISPLAYNAME) && !empty($displayName) && $displayName !== $oldDisplayName) {
$result = $this->backend->setDisplayName($this->uid, $displayName);
if ($result) {
$this->displayName = $displayName;
- $this->triggerChange('displayName', $displayName);
+ $this->triggerChange('displayName', $displayName, $oldDisplayName);
}
return $result !== false;
}