Skip to content
Snippets Groups Projects
Commit c84c1f51 authored by Joas Schilling's avatar Joas Schilling
Browse files

Correctly use groups parameter only when its not empty

Fix #9745
parent ddd8eae9
Branches
No related tags found
No related merge requests found
......@@ -5,18 +5,20 @@ 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"])) {
$groups = array();
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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment