} else { unset($sel); $shards = array(); } } else { $result = sqlquery("SELECT DISTINCT shard FROM service ORDER BY shard"); while ($result && ($arr = sqlfetch($result))) { $shards[] = $arr["shard"]; } } unset($cmdResult); if (isset($execServCommand) && isset($factPaths) && isset($execServParams) && isset($variableData[$execServCommand])) { // get command path $cmd = $variableData[$execServCommand]; $path = $cmd["path"]; $paths = expandQuery($factPaths); for ($i = 0; $i < count($paths); ++$i) { $fpath = filterPathUsingAliases($paths[$i], $path); if ($fpath != "") { $newPaths[] = $fpath; } } $fullPath = factorizeQuery("[" . join($newPaths, ",") . "]"); // filter selection with command $fullCmd = $fullPath . " " . $execServParams; logUser($uid, "COMMAND=" . $fullCmd); $qstate = nel_query($fullPath . " " . $execServParams, $cmdResult); } unset($ownerTables); // display available user and group views $result = sqlquery("SELECT view.name AS name, view.tid AS tid, view.uid AS gid, user.login AS owner FROM view_table AS view, user WHERE view.uid=user.uid AND (view.uid='{$uid}' OR view.uid='{$gid}') ORDER BY gid, ordering");
function expandQuery($query) { if (isAtom($query)) { return array($query); } //echo "expand query: $query<br>"; $blocs = splitQuery($query); //echo "splitted query: blocs="; //print_r($blocs); //echo "<br>-------------------<br>"; for ($i = 0; $i < count($blocs); ++$i) { $subblocs = splitBloc($blocs[$i]); //echo "splitted blocs: subblocs="; //print_r($subblocs); //echo "<br>-------------------<br>"; unset($nodes); $nodes = array(); for ($ii = 0; $ii < count($subblocs); ++$ii) { $nodes = array_merge($nodes, expandQuery($subblocs[$ii])); } if (count($current_nodes) >= 1) { $num_nodes = count($current_nodes); for ($j = 0; $j < $num_nodes; ++$j) { for ($k = 0; $k < count($nodes) - 1; ++$k) { $current_nodes[] = $current_nodes[$j] . "." . $nodes[$k]; } $current_nodes[$j] .= "." . $nodes[$k]; } } else { $current_nodes = $nodes; } } return $current_nodes; }