diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 4 | ||||
-rw-r--r-- | apps/provisioning_api/tests/Controller/UsersControllerTest.php | 3 | ||||
-rw-r--r-- | apps/settings/js/federationsettingsview.js | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index a26479ba0a8..839ac404c94 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -837,7 +837,9 @@ class UsersController extends AUserData { switch ($key) { case self::USER_FIELD_DISPLAYNAME: case IAccountManager::PROPERTY_DISPLAYNAME: - $targetUser->setDisplayName($value); + if (!$targetUser->setDisplayName($value)) { + throw new OCSException('Invalid displayname', 102); + } break; case self::USER_FIELD_QUOTA: $quota = $value; diff --git a/apps/provisioning_api/tests/Controller/UsersControllerTest.php b/apps/provisioning_api/tests/Controller/UsersControllerTest.php index 6162be54a04..4449302fedd 100644 --- a/apps/provisioning_api/tests/Controller/UsersControllerTest.php +++ b/apps/provisioning_api/tests/Controller/UsersControllerTest.php @@ -1486,7 +1486,8 @@ class UsersControllerTest extends TestCase { $targetUser ->expects($this->once()) ->method('setDisplayName') - ->with('NewDisplayName'); + ->with('NewDisplayName') + ->willReturn(true); $targetUser ->expects($this->any()) ->method('getUID') diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index 9eb0b930733..e05cc9f20f4 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -128,7 +128,8 @@ _.each(this._inputFields, function(field) { if ( field === 'avatar' || - field === 'email' + field === 'email' || + field === 'displayname' ) { return; } |