summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-01-24 13:39:17 +0100
committerJoas Schilling <coding@schilljs.com>2018-03-12 12:01:19 +0100
commit63089821a4b1b0f5bb16be62f70fcaf90c3ed3f9 (patch)
treec5f07db977356b088e740d46de437e0c7c1c54a7 /settings
parent97dbaa26c4d8a6f77794fd0f04348654fe529063 (diff)
downloadnextcloud-server-63089821a4b1b0f5bb16be62f70fcaf90c3ed3f9.tar.gz
nextcloud-server-63089821a4b1b0f5bb16be62f70fcaf90c3ed3f9.zip
Correctly return the group name
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/GroupsController.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/settings/Controller/GroupsController.php b/settings/Controller/GroupsController.php
index 8985a76ec95..19b7c53f8b9 100644
--- a/settings/Controller/GroupsController.php
+++ b/settings/Controller/GroupsController.php
@@ -28,6 +28,7 @@ use OC\AppFramework\Http;
use OC\Group\MetaData;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\DataResponse;
+use OCP\IGroup;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
@@ -108,13 +109,9 @@ class GroupsController extends Controller {
Http::STATUS_CONFLICT
);
}
- if($this->groupManager->createGroup($id)) {
- return new DataResponse(
- array(
- 'groupname' => $id
- ),
- Http::STATUS_CREATED
- );
+ $group = $this->groupManager->createGroup($id);
+ if($group instanceof IGroup) {
+ return new DataResponse(['groupname' => $group->getDisplayName()], Http::STATUS_CREATED);
}
return new DataResponse(
@@ -140,9 +137,7 @@ class GroupsController extends Controller {
return new DataResponse(
array(
'status' => 'success',
- 'data' => array(
- 'groupname' => $id
- )
+ 'data' => ['groupname' => $group->getDisplayName()]
),
Http::STATUS_NO_CONTENT
);