diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-07-20 15:04:50 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-07-20 15:04:50 +0200 |
commit | e42f7656970c0b9cf04a8b200eb6d5690b8c9c84 (patch) | |
tree | 55f28ac0149fdef782357cea8ba92ae746d670d1 /settings/ajax | |
parent | 91578883343d909da027790aa2458ad114b53aa0 (diff) | |
download | nextcloud-server-e42f7656970c0b9cf04a8b200eb6d5690b8c9c84.tar.gz nextcloud-server-e42f7656970c0b9cf04a8b200eb6d5690b8c9c84.zip |
simplify code of createuser.php
Diffstat (limited to 'settings/ajax')
-rw-r--r-- | settings/ajax/createuser.php | 11 |
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"]; |