Exemplo n.º 1
0
 // fix the nested array before merging
 for ($x = 0; $x < count($pls); $x++) {
     $newarr[] = $pls[$x]['class-name'];
 }
 if (count($newarr) !== 0) {
     $pls_opt = array_merge($pl_ops, $newarr);
     //echo "<pre>"; print_r( $pls_opt ); echo "</pre>";
 } else {
     $pls_opt = $pl_ops;
 }
 $list = $misc->GenDropMenuWSelectedPoolOpts($pls_opt, $allow_deny_op, 'allow_deny_op');
 /* 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 {
         $select_groups = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], "No groups defined", NULL, NULL);
     }
 } else {
     $select_groups = $err->GenerateErrorLink("help/help.html", "#undef", $defined['error'], $errors['db_select_err'], NULL, NULL);
 }
 if ($group === "admin") {
     $subnetquery = "SELECT * FROM `conf_subnets` ORDER BY `subnet-name` ASC";
 } else {
     $subnetquery = "SELECT * FROM `conf_subnets` WHERE `group` = \"" . $group . "\" ORDER BY `subnet-name` ASC";
 }
 if (($current = $db->dbQuery($val->ValidateSQL($subnetquery, $dbconn), $dbconn)) !== -1) {
     $subnetlist = $db->dbArrayResultsAssoc($current);
 }
 /* check for additional subnets this group can access */
 $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) {