Esempio n. 1
0
    $package = pg_escape_string($_REQUEST['package']);
    if ($package != '') {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/packages.php';
        $Packages = new Packages($db);
        $CategoryPort = $Packages->GetCategoryPortFromPackageName($package);
        switch ($CategoryPort) {
            case "0":
                # no such port found
                header('Location: /package.php?package=' . $package . '&notfound');
                exit;
            case "-1":
                # multiple ports have that package name
                # search for them all and let the users decide which one they want
                require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/searches.php';
                $Searches = new Searches($dbh);
                $Redirect = $Searches->GetLink($package, FRESHPORTS_SEARCH_METHOD_Exact, 1);
                header('Location: ' . $Redirect);
                exit;
            default:
                # one port found with that name, show that page.
                header('Location: /' . $CategoryPort . '/');
                exit;
        }
    }
}
freshports_Start($FreshPortsSlogan, $FreshPortsName . ' - new ports, applications', 'FreeBSD, index, applications, ports');
$Debug = 1;
if ($Debug) {
    echo "\$User->id='{$User->id}'";
}
function freshports_SummaryForDay($MinusN)