summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-01-25 22:16:25 -0600
committerGitHub <noreply@github.com>2017-01-25 22:16:25 -0600
commit3be746d66006529fb9a8661f679b2052764621e8 (patch)
tree0d344b5576bdef04d0f03cbf1da1586baaa3577e /settings
parent659d4b8d32aadfb52ce743f854b087b334ad2550 (diff)
parent73856ac6397031d4587963599253596987a173d5 (diff)
downloadnextcloud-server-3be746d66006529fb9a8661f679b2052764621e8.tar.gz
nextcloud-server-3be746d66006529fb9a8661f679b2052764621e8.zip
Merge pull request #3208 from nextcloud/issue-3125-bring-user-management-endpoints-in-line
Error out when subadmin doesn't select any group
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/UsersController.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index 28b8d2648d9..43a38432499 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -346,13 +346,12 @@ class UsersController extends Controller {
}
if (empty($groups)) {
- $groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($currentUser);
- // New class returns IGroup[] so convert back
- $gids = [];
- foreach ($groups as $group) {
- $gids[] = $group->getGID();
- }
- $groups = $gids;
+ return new DataResponse(
+ array(
+ 'message' => $this->l10n->t('No valid group selected'),
+ ),
+ Http::STATUS_FORBIDDEN
+ );
}
}
@@ -380,7 +379,7 @@ class UsersController extends Controller {
);
}
- if($user instanceof User) {
+ if($user instanceof IUser) {
if($groups !== null) {
foreach($groups as $groupName) {
$group = $this->groupManager->get($groupName);