summaryrefslogtreecommitdiffstats
path: root/settings/Controller/UsersController.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller/UsersController.php')
-rw-r--r--settings/Controller/UsersController.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index 08d97a0f581..94f97a35613 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -603,8 +603,9 @@ class UsersController extends Controller {
// keep the user back-end up-to-date with the latest display name and email
// address
- if (isset($data['displayName']['value']) && $user->getDisplayName() !== $data['displayName']['value']) {
- $result = $user->setDisplayName($data['displayName']['value']);
+ $oldDisplayName = $user->getDisplayName();
+ if (isset($data[AccountManager::PROPERTY_DISPLAYNAME]['value']) && $oldDisplayName !== $data[AccountManager::PROPERTY_DISPLAYNAME]['value']) {
+ $result = $user->setDisplayName($data[AccountManager::PROPERTY_DISPLAYNAME]['value']);
if ($result === false) {
throw new ForbiddenException($this->l10n->t('Unable to change full name'));
}