summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-07-20 15:04:50 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-07-20 15:04:50 +0200
commite42f7656970c0b9cf04a8b200eb6d5690b8c9c84 (patch)
tree55f28ac0149fdef782357cea8ba92ae746d670d1 /settings/ajax
parent91578883343d909da027790aa2458ad114b53aa0 (diff)
downloadnextcloud-server-e42f7656970c0b9cf04a8b200eb6d5690b8c9c84.tar.gz
nextcloud-server-e42f7656970c0b9cf04a8b200eb6d5690b8c9c84.zip
simplify code of createuser.php
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/createuser.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index 41bf31a05f6..f16e91e2001 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -18,21 +18,18 @@ if($isadmin){
$groups = $_POST["groups"];
}
}else{
- $accessiblegroups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
- $accessiblegroups = array_flip($accessiblegroups);
if(isset( $_POST["groups"] )){
- $unauditedgroups = $_POST["groups"];
$groups = array();
- foreach($unauditedgroups as $group){
- if(array_key_exists($group, $accessiblegroups)){
+ foreach($_POST["groups"] as $group){
+ if(OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group)){
$groups[] = $group;
}
}
if(count($groups) == 0){
- $groups = array_flip($accessiblegroups);
+ $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
}
}else{
- $groups = array_flip($accessiblegroups);
+ $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser());
}
}
$username = $_POST["username"];