summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-01-23 11:23:38 +0100
committerJoas Schilling <coding@schilljs.com>2017-01-23 11:58:58 +0100
commit73856ac6397031d4587963599253596987a173d5 (patch)
treedbe82ca0ea84944dfc54bfdd477484ccac1e8204 /settings/Controller
parent16afaa783b8e7b0e728543556c92dcc93241ae4b (diff)
downloadnextcloud-server-73856ac6397031d4587963599253596987a173d5.tar.gz
nextcloud-server-73856ac6397031d4587963599253596987a173d5.zip
Error out when subadmin doesn't select any group
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/Controller')
-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);