foreach ($subnets_all as $sb) { if ($sb['subnet_dec'] !== $s['subnet_dec'] && $sb['mask'] !== $s['mask']) { if ($Subnets->is_subnet_inside_subnet($s['subnet'], $sb['subnet'])) { $subnets_all[$k]['master'] = $sb['subnet']; } } } } # import each if (isset($subnets_all)) { foreach ($subnets_all as $s) { # set new POST $_POST = $s; # create csrf token $_POST['csrf_cookie'] = $User->csrf_cookie("create", "subnet"); # permissions $subnet['permissions'] = $section->permissions; # check for master if (isset($s['master'])) { // find id $master = $Subnets->find_subnet($s['sectionId'], $s['master']); if ($master !== false) { $_POST['masterSubnetId'] = $master->id; } } # include edit script include dirname(__FILE__) . "/../../admin/subnets/edit-result.php"; } } else { $Result->show("danger", "No subnets selected", true); }