$sql = "SELECT `resource`, `allowed` FROM `auth_groups_perms` WHERE `type` = \"subnet\" AND `allowed` = \"" . $group . "\" AND `group` != \"" . $group . "\"";
 if (($extra = $db->dbQuery($val->ValidateSQL($sql, $dbconn), $dbconn)) !== -1) {
     $extra = $db->dbArrayResultsAssoc($extra);
     foreach ($extra as $key => $value) {
         $sql = "SELECT * FROM `conf_subnets` WHERE `subnet-name` = \"" . $value['resource'] . "\" LIMIT 1";
         if (($s = $db->dbQuery($val->ValidateSQL($sql, $dbconn), $dbconn)) !== -1) {
             $subnetlist_remainder = array_merge($misc->EliminiateDuplicates($db->dbArrayResultsAssoc($s)));
         }
     }
 }
 // combine our arrays
 if (count($subnetlist_remainder) !== 0) {
     $subnetlist = array_merge($subnetlist, $subnetlist_remainder);
 }
 //echo "<pre>"; print_r( $resources ); echo "</pre>";
 $subnets = $misc->GenJumpMenuBoxSubnets($subnetlist, 'subnets', $_GET['skin']);
 /* create checkbox list of available groups */
 $groupsquery = "SELECT * FROM `auth_groups` WHERE `group` != \"admin\" AND `group` != \"" . $group . "\" ORDER BY `group` ASC";
 if (($res = $db->dbQuery($val->ValidateSQL($groupsquery, $dbconn), $dbconn)) !== -1) {
     $groups = $db->dbArrayResultsAssoc($res);
     $groups = $misc->EliminiateDuplicates($groups);
     if (count($groups) !== 0) {
         // figure out which boxes are currently enabled
         if (!empty($_GET['id'])) {
             $sql = "SELECT * FROM `auth_groups_perms` WHERE `resource` = \"" . $subnet_name . "\"";
             if (($sql_res = $db->dbQuery($val->ValidateSQL($sql, $dbconn), $dbconn)) !== -1) {
                 $select_groups = $db->dbArrayResultsAssoc($sql_res);
             }
         }
         $select_groups = $misc->GenGroupsCheckBoxes($groups, 'select_groups', $_GET['skin'], $select_groups, $group);
     } else {