// Now loop through pbi origins $col=1; // Set the counter $curItem=0; $atEnd = true; foreach ($pbilist as $pbiorigin) // Is this PBIs origin package installed? if ( array_search($pbiorigin, $pkglist) !== false) { // Is this PBI just a DEP for another app? If so, skip it $output=""; exec("/usr/local/bin/syscache ".escapeshellarg("pkg $jail local $pbiorigin rdependencies"), $output); if ( "$output[0]" != "$SCERROR" ) continue; parse_details($pbiorigin, "$jail", $col, true, false); if ( $col == $totalCols ) $col = 1; else $col++; $curItem++; } echo "</tr>"; ?> </table> </div>
function display_app_link($pbilist, $jail) { $rlist = explode(" ", $pbilist); $totalCols = 2; $col = 1; echo " <table class=\"jaillist\" style=\"width:100%\">"; echo " <tr>\n"; echo " <th></th>\n"; echo " <th></th>\n"; echo " </tr>"; foreach ($rlist as $related) { parse_details($related, $jail, $col, false, false); if ($col == $totalCols) { $col = 1; } else { $col++; } } echo "</tr>"; echo "</table>\n"; }
// Set the counter $curItem = 0; $atEnd = true; foreach ($pkglist as $pbiorigin) { // Is this PBIs origin package installed? $sccmd = array("{$jail} app-summary {$pbiorigin}"); $response = send_sc_query($sccmd); $pbiarray = $response["{$jail} app-summary {$pbiorigin}"]; // If we have PBI data for this, the canremove will be on section 9 if (array_search($pbiorigin, $pbilist) !== false) { $pbicanremove = $pbiarray[9]; } else { $pbicanremove = $pbiarray[5]; } if ("{$pbicanremove}" != "true") { continue; } parse_details($pbiorigin, "{$jail}", $col, true, false, $pbiarray); if ($col == $totalCols) { $col = 1; } else { $col++; } $curItem++; } echo "</tr>"; ?> </table> </div>
$cmd = "pbi search '{$searchtext}' all 20"; } exec("{$sc} " . escapeshellarg("{$cmd}"), $pbiarray); $pbilist = explode(", ", $pbiarray[0]); $found = 0; // Now loop through pbi origins $col = 1; foreach ($pbilist as $pbiorigin) { if (empty($pbiorigin)) { continue; } if ($found > 60) { break; } $found++; if (parse_details($pbiorigin, $jail, $col, true, false) == 0) { if ($col == $totalCols) { $col = 1; } else { $col++; } } } if ($found == 0) { if ($searchraw == "checked") { echo "<tr><td colspan=3>No PBIs / Packages found!</td></tr>"; } else { echo "<tr><td colspan=3>No PBIs found! Try searching for all available PBI / Packages.</td></tr>"; } } else { if ($found == 1) {
$response = send_sc_query($sccmd); $pbiarray = $response["{$cmd}"]; $fulllist = $pbiarray; $catsearch = $_GET['cat'] . "/"; $pbilist = array_filter($fulllist, function ($var) use($catsearch) { return preg_match("|^{$catsearch}|", $var); }); } else { $sccmd = array("pbi list recommended", "pbi list new"); $response = send_sc_query($sccmd); $pbilist = $response["pbi list recommended"]; $newlist = $response["pbi list new"]; $pbilist = array_merge($pbilist, $newlist); //array_splice($pbilist, 16); } // Now loop through pbi origins $col = 1; foreach ($pbilist as $pbiorigin) { if (parse_details($pbiorigin, $jail, $col) == 0) { if ($col == $totalCols) { $col = 1; } else { $col++; } } } echo "</tr>"; echo "</table>"; ?>