diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-21 20:45:24 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-21 20:45:24 +0200 |
commit | 675e3eec325e24da09033eb7420e263ec14e6330 (patch) | |
tree | d93ca38223b6c56971ca946754cadc2622ce0f06 /settings | |
parent | 677c0288fbc99f4fd9994d70b708ef7a567d257e (diff) | |
parent | c84c1f519f96ab995e8d3c2f65951e32d8d01547 (diff) | |
download | nextcloud-server-675e3eec325e24da09033eb7420e263ec14e6330.tar.gz nextcloud-server-675e3eec325e24da09033eb7420e263ec14e6330.zip |
Merge pull request #9750 from owncloud/issue/9745
Correctly use groups parameter only when its not empty
Diffstat (limited to 'settings')
-rw-r--r-- | settings/ajax/createuser.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php index ae1d8856f43..463c15d59e8 100644 --- a/settings/ajax/createuser.php +++ b/settings/ajax/createuser.php @@ -5,21 +5,23 @@ OC_JSON::checkSubAdminUser(); if(OC_User::isAdminUser(OC_User::getUser())) { $groups = array(); - if( isset( $_POST["groups"] )) { + if (!empty($_POST["groups"])) { $groups = $_POST["groups"]; } }else{ - if(isset( $_POST["groups"] )) { + if (isset($_POST["groups"])) { $groups = array(); - foreach($_POST["groups"] as $group) { - if(OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group)) { - $groups[] = $group; + if (!empty($_POST["groups"])) { + foreach ($_POST["groups"] as $group) { + if (OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group)) { + $groups[] = $group; + } } } - if(count($groups) === 0) { + if (empty($groups)) { $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()); } - }else{ + } else { $groups = OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()); } } |