diff options
Diffstat (limited to 'apps/provisioning_api/lib/Controller/GroupsController.php')
-rw-r--r-- | apps/provisioning_api/lib/Controller/GroupsController.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/provisioning_api/lib/Controller/GroupsController.php b/apps/provisioning_api/lib/Controller/GroupsController.php index 543fc3b40ac..7b6e5319c2a 100644 --- a/apps/provisioning_api/lib/Controller/GroupsController.php +++ b/apps/provisioning_api/lib/Controller/GroupsController.php @@ -232,10 +232,11 @@ class GroupsController extends AUserData { * @PasswordConfirmationRequired * * @param string $groupid + * @param string $displayname * @return DataResponse * @throws OCSException */ - public function addGroup(string $groupid): DataResponse { + public function addGroup(string $groupid, string $displayname = ''): DataResponse { // Validate name if (empty($groupid)) { $this->logger->error('Group name not supplied', ['app' => 'provisioning_api']); @@ -245,7 +246,13 @@ class GroupsController extends AUserData { if ($this->groupManager->groupExists($groupid)) { throw new OCSException('group exists', 102); } - $this->groupManager->createGroup($groupid); + $group = $this->groupManager->createGroup($groupid); + if ($group === null) { + throw new OCSException('Not supported by backend', 103); + } + if ($displayname !== '') { + $group->setDisplayName($displayname); + } return new DataResponse(); } |