diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-04-06 16:14:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 16:14:12 +0300 |
commit | d45a889fe22273aab64e8a339b57da097988cd36 (patch) | |
tree | a623b126b677f04fffd4b06bc2efef740743636f /settings | |
parent | b9ca1216712f9eff0471ac58d49b8ee8391a5d28 (diff) | |
parent | 5e15c76d214d6d1425bf05ceaa937371e71eaa38 (diff) |
Merge pull request #8779 from nextcloud/backport/8255/show-group-display-names
[stable13] Show group display names
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/GroupsController.php | 15 |
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 ); |