exit; /* Make sure that code below does not get executed when we redirect. */ } else { if ($User->id != '') { // read the users current watch information from the database $sql = "\n select watch_list_element.element_id \n\t from watch_list_element, watch_list, ports \n\t where watch_list_element.watch_list_id = watch_list.id \n\t and watch_list.user_id = {$User->id} \n\t and watch_list.id = {$wlid}\n\t and watch_list_element.element_id = ports.element_id"; $result = pg_exec($db, $sql); $numrows = pg_numrows($result); // read each value and set the variable accordingly for ($i = 0; $i < $numrows; $i++) { $myrow = pg_fetch_array($result, $i); // we use these to see if a particular port is selected ${"port_" . $myrow["element_id"]} = 1; } } freshports_Start($category, "freshports - new ports, applications", "FreeBSD, index, applications, ports"); } ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <tr> <?php echo freshports_PageBannerText("Watch List - " . $category);
<?php # # $Id: inthenews.php,v 1.2 2006-12-17 12:06:11 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('In The News', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <table width="100%" border="0"> <tr> <?php echo freshports_PageBannerText("In the news"); ?> </tr> <TR> <TD VALIGN="top"> <p>This page is just a place for me to record the <?php echo $FreshPortsTitle; ?> articles which appear
<?php # # $Id: vote.php,v 1.2 2007-04-02 03:34:14 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/design-voting/voting.php'; $Debug = 0; $Title = "FreshPorts Design Contest - Voting"; freshports_Start($Title, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); echo freshports_MainTable(); ?> <tr><td valign="top" width="100%" colspan="2"> <table width="100%" border="0"> <tr> <?php echo freshports_PageBannerText($Title); ?> </tr> </table> </td></tr> <tr><td valign="top" width="100%"> <?php if (!$User->id) { echo 'You must login to vote.';
# # ensure casesensitivity has an appropriate value # switch ($casesensitivity) { case 'casesensitive': # do nothing break; default: $casesensitivity = 'caseinsensitive'; # do not break here... } # if ($Debug) phpinfo(); if (!isset($_REQUEST['query'])) { $OnLoad = 'setfocus()'; } freshports_Start('Search', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <script language="JavaScript" type="text/javascript"> <!-- function setfocus() { document.search.query.focus(); } // --> </script> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?>
<?php # # $Id: release-2003-04-29.php,v 1.3 2012-09-01 16:33:19 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); $Title = "New Release - 29 April 2003"; freshports_Start($Title, "freshports - new ports, applications", "FreeBSD, index, applications, ports"); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(NOBORDER); ?> <TR> <?php echo freshports_PageBannerText($Title); ?> </TR>
<?php # # $Id: confirmation.php,v 1.2 2006-12-17 12:06:09 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start('Account confirmation', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); $Debug = 0; $ResultConfirm = 999; $token = $_GET['token']; if (isset($token)) { $token = pg_escape_string($token); if ($Debug) { echo "I'm confirming with token {$token}\n<BR>"; } $sql = "select ConfirmUserAccount('{$token}')"; $result = pg_exec($db, $sql); if ($result) { $row = pg_fetch_array($result, 0); $ResultConfirm = $row[0]; } else { echo pg_errormessage() . $sql; } } ?>
<?php # # $Id: about.php,v 1.3 2012-07-21 23:23:57 dan Exp $ # # Copyright (c) 1998-2006 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start("About this site", "freshports - new ports, applications", "FreeBSD, index, applications, ports"); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(NOBORDER); ?> <TR> <?php echo freshports_PageBannerText("About this site"); ?> </TR> <TR><TD>
<?php # # $Id: committer-opt-in.php,v 1.5 2009-01-08 19:47:08 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start('Committer opt-in', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); if (!eregi(".*@FreeBSD.org", $User->email)) { echo 'Why are you here?'; exit; } if (isset($_POST["subscribe"]) && $_POST["subscribe"] && !empty($visitor)) { # if not an email address if (strrpos($_POST["email"], '@') === false) { $committer = pg_escape_string($_POST["email"]); $sql = "insert into committer_notify (user_id, committer, status)\n\t \t\t\tvalues ({$User->id}, '{$committer}', 'A')"; if ($Debug) { echo "sql={$sql}<br>\n"; } $result = pg_exec($db, $sql) or die("insert query failed " . pg_errormessage()); if (!$result) { die("determine committer subscribe failed " . pg_errormessage()); } } else { die("please enter just your login, not your email address"); }
exit; /* Make sure that code below does not get executed when we redirect. */ } } else { $errors .= 'Something went terribly wrong there.<br>'; $errors .= $sql . "<br>\n"; $errors .= pg_errormessage(); } } } else { $email = $User->email; $numberofdays = $User->number_of_days; $page_size = $User->page_size; } # echo '<br>the page size is ' . $page_size . ' : ' . $email; freshports_Start('Customize User Account', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <TABLE WIDTH="<?php echo $TableWidth; ?> " BORDER="0" ALIGN="center"> <TR><TD VALIGN="top" width="100%"> <TABLE width="100%" border="0"> <TR> <TD height="20"><script language="php"> if ($errors) { echo '<TABLE CELLPADDING="1" BORDER="0" BGCOLOR="' . BACKGROUND_COLOUR . '" width="100%"> <TR>
<?php # # $Id: graphs2.php,v 1.2 2012-07-21 23:23:57 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start('Statistics - everyone loves a graph', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <script src="jquery-1.2.6.min.js"></script> <script src="jquery.flot.pack.js"></script> <script src="graphs.js"></script> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText("Statistics - everyone loves a graph"); ?>
<?php # # $Id: privacy.php,v 1.4 2012-07-21 23:23:58 dan Exp $ # # Copyright (c) 1998-2006 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('Privacy Policy', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText('Privacy statement'); ?> </TR> <TR><TD>
<?php # # $Id: authors.php,v 1.4 2012-07-21 23:23:57 dan Exp $ # # Copyright (c) 1998-2006 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('The Authors', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <tr> <?php echo freshports_PageBannerText("About the authors"); ?> </tr> <TR><TD> <CENTER>
<?php # # $Id: how-big-is-it.php,v 1.7 2012-07-21 23:23:57 dan Exp $ # # Copyright (c) 1998-2006 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('How big is it?', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); $Total = 0; function format_number($Value) { return str_replace(' ', ' ', sprintf('%6s', $Value)); } # # grabbed from http://ca3.php.net/manual/en/function.number-format.php # was attributed there to: Thanks to "php dot net at alan-smith dot no-ip dot com" and "service at dual-creators dot de". # function human_readable($size) { $count = 0; $format = array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); while ($size / 1024 > 1 && $count < 8) { $size = $size / 1024; $count++; } if ($size < 10) {
function freshports_CategoryDisplay($db, $category, $PageNo = 1, $PageSize = DEFAULT_PAGE_SIZE) { global $TableWidth; global $User; header('HTTP/1.1 200 OK'); $Debug = 0; if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { if (isset($_SERVER["REDIRECT_QUERY_STRING"])) { parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts); if (isset($query_parts['page'])) { $PageNo = $query_parts['page']; } if (isset($query_parts['page_size'])) { $PageSize = $query_parts['page_size']; } } } if (!isset($page) || $page == '') { $page = 1; } if (!isset($page_size) || $page_size == '') { $page_size = $User->page_size; } if ($Debug) { echo "\$page = '{$page}'<br>\n"; echo "\$page_size = '{$page_size}'<br>\n"; } SetType($PageNo, "integer"); SetType($PageSize, "integer"); if (!isset($PageNo) || !str_is_int("{$PageNo}") || $PageNo < 1) { $PageNo = 1; } if (!isset($PageSize) || !str_is_int("{$PageSize}") || $PageSize < 1 || $PageSize > MAX_PAGE_SIZE) { $PageSize = DEFAULT_PAGE_SIZE; } if ($Debug) { echo "\$PageNo = '{$PageNo}'<br>\n"; echo "\$PageSize = '{$PageSize}'<br>\n"; } require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/categories.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/watch_lists.php'; if ($category->IsPrimary()) { $WatchLists = new WatchLists($db); $WatchListCount = $WatchLists->IsOnWatchList($User->id, $category->element_id); } $title = $category->{'name'}; # find out how many ports are in this category $PortCount = $category->PortCount($category->name); global $User; if ($Debug) { echo "\$User->id='{$User->id}'"; } freshports_Start($title, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); $port = new Port($db); $numrows = $port->FetchByCategoryInitialise($category->name, $User->id, $PageSize, $PageNo); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <tr> <?php echo freshports_PageBannerText('Category listing - ' . $category->{'name'}); ?> </tr> <tr><td> <?php if ($category->IsPrimary()) { if ($WatchListCount) { echo freshports_Watch_Link_Remove('', 0, $category->{'element_id'}); } else { echo freshports_Watch_Link_Add('', 0, $category->{'element_id'}); } } ?> <BIG><BIG><B><?php echo $category->{'description'}; ?> </B></BIG></BIG>- Number of ports in this category: <?php echo $PortCount; ?> <p> Ports marked with a <sup>*</sup> actually reside within another category but have <b><?php echo $category->{'name'}; ?> </b> listed as a secondary category. <?php global $ShowAds, $BannerAd; if ($ShowAds && $BannerAd) { echo "<br><center>\n" . Ad_728x90() . "\n</center>\n"; } echo '<div align="center"><br>'; freshports_CategoryNextPreviousPage($category->name, $PortCount, $PageNo, $PageSize); echo '</div>'; ?> </td></tr> <?php if ($Debug) { echo "\$CategoryID = '{$CategoryID}'<BR>\n"; echo "GlobalHideLastChange = {$GlobalHideLastChange}<BR>\n"; echo "\$numrows = {$numrows}<BR>\n"; } $ShowShortDescription = "Y"; $HTML = freshports_echo_HTML("<TR>\n<TD>\n"); require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/port-display.php'; $port_display = new port_display($db, $User); $port_display->SetDetailsCategory(); for ($i = 0; $i < $numrows; $i++) { $port->FetchNth($i); $port_display->port = $port; $Port_HTML = $port_display->Display(); $HTML .= $port_display->ReplaceWatchListToken($port->{'onwatchlist'}, $Port_HTML, $port->{'element_id'}); } // end for echo $HTML; ?> </TD></TR> <TR><TD> <div align="center"><br> <?php freshports_CategoryNextPreviousPage($category->name, $PortCount, $PageNo, $PageSize); ?> </div> </TD></TR> </TABLE> <TD VALIGN="top" WIDTH="*" ALIGN="center"> <?php echo freshports_SideBar(); ?> </td> </TR> </TABLE> <?php echo freshports_ShowFooter(); ?> </body> </html> <?php }
require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/watch-lists.php'; $visitor = $_COOKIE['visitor']; unset($add_name); unset($rename_name); $ValidCharacters = 'a-z, A-Z, and 0-9'; $WatchListNameMessage = 'Watch list names must contain only A..Z, a..z, or 0..9.'; // if we don't know who they are, we'll make sure they login first if (!$visitor) { header('Location: /login.php?origin=' . $_SERVER['PHP_SELF']); /* Redirect browser to PHP web site */ exit; /* Make sure that code below does not get executed when we redirect. */ } require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/watch_lists.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/user.php'; freshports_Start('Watch list maintenance', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); #phpinfo(); $Debug = 0; $ConfirmationNeeded['delete'] = 1; $ConfirmationNeeded['delete_all'] = 1; $ConfirmationNeeded['empty'] = 1; $ConfirmationNeeded['empty_all'] = 1; $UserClickedOn = ''; $ErrorMessage = ''; if ($_POST['delete']) { $UserClickedOn = 'delete'; } if ($_POST['delete_all']) { $UserClickedOn = 'delete_all'; } if ($_POST['empty']) {
<?php # $Id: help.php,v 1.2 2006-12-17 12:06:11 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('pkg_info >> watch list', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(NOBORDER); ?> <TR> <?php echo freshports_PageBannerText("pkg_info and your watch list "); ?> </TR> <TR><TD> <P> One of the most powerful FreshPorts features is the ability to tap the existing information on your FreeBSD system and use it to
# $Id: report-subscriptions.php,v 1.2 2006-12-17 12:06:16 dan Exp $ # # Copyright (c) 1998-2006 DVL Software Limited # if (!$_COOKIE['visitor']) { header('Location: /login.php?origin=' . $_SERVER['PHP_SELF']); /* Redirect browser to PHP web site */ exit; /* Make sure that code below does not get executed when we redirect. */ } require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; $ArticleTitle = 'Report subscriptions'; freshports_Start($ArticleTitle, '', 'FreeBSD, daemon copyright'); $Debug = 0; if ($Debug) { phpinfo(); } function freshports_ReportFrequencies($dbh) { $sql = 'select id, frequency, description from report_frequency order by id'; $result = pg_exec($dbh, $sql); if ($result) { $numrows = pg_numrows($result); for ($i = 0; $i < $numrows; $i++) { $myrow = pg_fetch_array($result, $i); # we don't include don't notify me.
if ($IsElement && !$IsPort) { if ($Debug) { echo 'This is an element<br>'; } require_once $_SERVER['DOCUMENT_ROOT'] . '/missing-non-port.php'; freshports_NonPortDescription($db, $ElementRecord); exit; } return $result; } $result = freshports_Parse404URI($_SERVER['REDIRECT_URL'], $db); if ($result) { # # this is a true 404 $Title = 'Document not found'; freshports_Start($Title, $FreshPortsTitle . ' - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <TR> <TD WIDTH="100%" VALIGN="top"> <?php echo freshports_MainContentTable(); ?> <TR> <TD BGCOLOR="<?php echo BACKGROUND_COLOUR; ?> " HEIGHT="29"><FONT COLOR="#FFFFFF"><BIG><BIG>
if ($Debug) { echo "I would have taken you to '" . htmlentities($origin) . "' now, but debugging is on<br>\n"; } else { // Redirect browser to PHP web site if ($origin == "/index.php" || $origin == '') { $origin = "/"; } header("Location: {$origin}"); exit; /* Make sure that code below does not get executed when we redirect. */ } } else { echo 'Something went terribly wrong there.<br>'; } } freshports_Start("your email is bouncing", "freshports - new ports, applications", "FreeBSD, index, applications, ports"); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(NOBORDER); ?> <tr> <?php echo freshports_PageBannerText("Bouncing? What do you mean?"); ?>
while (list($key, $value) = each($categories)) { $result = $WatchListElement->Add($User->id, $wlid, $value); # ${"category_".$value} = 1; if ($result != 1) { syslog(LOG_ERR, $_SERVER["PHP_SELF"] . ": could not clear watch list '{$wlid}' owned by '{$User->id}' of element '{$value}' in " . __FILE__ . ':' . __LINE__); die("error clear list before saving"); } } } pg_exec($db, "COMMIT"); header("Location: filter-setup.php"); /* Redirect browser */ exit; /* Make sure that code below does not get executed when we redirect. */ } freshports_Start('Watch categories', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); $Debug = 0; if ($Debug) { # phpinfo(); $visitor = $_COOKIE["visitor"]; } if ($_REQUEST['wlid']) { # they clicked on the GO button and we have to apply the # watch staging area against the watch list. $wlid = pg_escape_string($_REQUEST["wlid"]); if ($Debug) { echo "setting SetLastWatchListChosen => \$wlid='{$wlid}'"; } $User->SetLastWatchListChosen($wlid); if ($Debug) { echo "\$wlid='{$wlid}'";
<?php # # $Id: my-flagged-commits.php,v 1.4 2012-07-21 23:23:58 dan Exp $ # # Copyright (c) 1998-2004 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; require_once 'Pager/Pager.php'; freshports_Start($FreshPortsSlogan, $FreshPortsName . ' - new ports, applications', 'FreeBSD, index, applications, ports'); $Debug = 0; if ($Debug) { echo "\$User->id='{$User->id}'"; } echo freshports_MainTable(); $num = $MaxNumberOfPortsLong; $days = $NumberOfDays; $dailysummary = 7; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/commits_my_flagged.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/display_commit.php'; $CommitsMyFlagged = new CommitsMyFlagged($db); $CommitsMyFlagged->Debug = $Debug; $CommitsMyFlagged->UserIDSet($User->id); $NumberCommits = $CommitsMyFlagged->Fetch(); $NumberCommits = $CommitsMyFlagged->GetCountPortCommits(); if ($Debug) { echo 'number of commits = ' . $NumberCommits . "<br>\n"; }
$CategoryName = pg_escape_string($_REQUEST['category']); $Category = new Category($db); $CategoryID = $Category->FetchByName($CategoryName); if (!$CategoryID) { die("I don't know that category: {$CategoryName}"); } if ($Category->IsPrimary() == 't') { $IsPrimary = 1; } else { $IsPrimary = 0; } if (isset($_REQUEST['update'])) { $Category->{description} = pg_escape_string($_REQUEST['description']); $Category->UpdateDescription(); } freshports_Start($Title . ' - ' . $CategoryName, 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <TABLE WIDTH="<?php echo $TableWidth; ?> " BORDER="0" ALIGN="center"> <TR><TD VALIGN="top" WIDTH="100%"> <TABLE WIDTH="100%" BORDER="0"> <TR> <?php echo freshports_PageBannerText($Title . ' - ' . $CategoryName); ?> </TR> <TR><TD> <p>
syslog(LOG_NOTICE, "Password reset page: Token not deleted after reset: " . $token); $errors = "It seems that token is no longer valid.<br>"; } } if ($PasswordReset == 1) { if ($Debug) { echo "I would have taken you to '{$origin}' now, but debugging is on<br>\n"; } } else { $errors .= 'Something went terribly wrong there.<br>'; syslog(LOG_NOTICE, "Password reset page: Password reset went wrong " . $sql . ' ' . pg_errormessage()); } } } # echo '<br>the page size is ' . $page_size . ' : ' . $email; freshports_Start('Reset password via token', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <TABLE WIDTH="<?php echo $TableWidth; ?> " BORDER="0" ALIGN="center"> <TR><TD VALIGN="top" width="100%"> <TABLE width="100%" border="0"> <TR> <TD height="20"><script language="php"> if ($errors) { echo '<TABLE CELLPADDING="1" BORDER="0" BGCOLOR="' . BACKGROUND_COLOUR . '" width="100%"> <TR>
} if ($OKToMail) { $sql = "insert into user_password_reset (user_id, ip_address) values (" . $myrow["id"] . ", '" . $_SERVER['REMOTE_ADDR'] . "') returning token"; $token_result = pg_exec($db, $sql) or die('password token creation failed ' . pg_errormessage()); $token_row = pg_fetch_array($token_result, 0); $token = $token_row["token"]; # send out email $message = "Someone, perhaps you, requested that you be emailed your password.\n" . "If that wasn't you, and this message becomes a nuisance, please\n" . "forward this message to webmaster@freshports.org and we will take\n" . "care of it for you.\n" . " \n" . "Your login id is: " . $myrow["name"] . "\n\n" . "Your password recovery URL is:\n" . "http://" . $_SERVER["SERVER_NAME"] . "/password-reset-via-token.php?token=" . $token . "\n" . "\n" . "the request came from " . $_SERVER["REMOTE_ADDR"] . ':' . $_SERVER["REMOTE_PORT"]; mail($myrow["email"], "FreshPorts - password", $message, "From: webmaster@freshports.org\nReply-To: webmaster@freshports.org\nX-Mailer: PHP/" . phpversion()); $MailSent = 1; syslog(LOG_NOTICE, "Forgotten password: email for '" . $myrow['name'] . "' sent to '" . $myrow['email'] . "': " . $token); } } } } freshports_Start('Forgotten password', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <TABLE WIDTH="100%" BORDER="0"> <TR> <TD> <TABLE WIDTH="100%" BORDER="0"> <TR><TD VALIGN="top" WIDTH="100%"> <?php if (isset($error) and $error != '') { echo '<TABLE CELLPADDING="1" BORDER="0" BGCOLOR="' . BACKGROUND_COLOUR . '" WIDTH="100%"> <TR> <TD> <TABLE WIDTH="100%" BORDER="0" CELLPADDING="1"> <TR BGCOLOR="' . BACKGROUND_COLOUR . '"><TD><b><FONT COLOR="#ffffff" SIZE="+2">We have a problem!</FONT></b></TD> </TR>
function freshports_PortDisplay($db, $category, $port) { global $TableWidth; global $FreshPortsTitle; global $User; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/port-display.php'; # these two options must be the last on the line. And as such are mutually exclusive define('BYPASSCACHE', 'bypasscache=1'); # do not read the cache for display define('REFRESHCACHE', 'refreshcache=1'); # refresh the cache $BypassCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(BYPASSCACHE)) == BYPASSCACHE; $RefreshCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(REFRESHCACHE)) == REFRESHCACHE; $Debug = 0; if ($Debug) { echo 'into ' . __FILE__ . ' now' . "<br>\n"; } $PageNumber = 1; if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts); } else { $query_parts = null; } if ($Debug) { echo print_r($query_parts, true); } if (isset($query_parts['page']) && Is_Numeric($query_parts['page'])) { $PageNumber = intval($query_parts['page']); if ($PageNumber != $query_parts['page'] || $PageNumber < 1) { $PageNumber = 1; } } $port_display = new port_display($db, $User); $port_display->SetDetailsFull(); $Cache = new CachePort(); $Cache->PageSize = $User->page_size; $result = $Cache->RetrievePort($category, $port, CACHE_PORT_DETAIL, $PageNumber); if (!$result && !$BypassCache && !$RefreshCache) { if ($Debug) { echo "found something from the cache<br>\n"; } $HTML = $Cache->CacheDataGet(); # # we need to know the element_id of this port # and the whether or not it is on the person's watch list # let's create a special function for that! # $EndOfFirstLine = strpos($HTML, "\n"); if ($EndOfFirstLine == false) { die('Internal error: I was expecting an ElementID and found nothing'); } # extract the ElementID from the cache $ElementID = intval(substr($HTML, 0, $EndOfFirstLine)); if ($ElementID == 0) { syslog(LOG_ERR, "Extract of ElementID from cache failed. Is cache corrupt/deprecated? port was {$category}/{$port}"); die('sorry, I encountered a problem with the cache. Please send the URL and this message to the webmaster.'); } if ($User->id) { $OnWatchList = freshports_OnWatchList($db, $User->id, $ElementID); } else { $OnWatchList = 0; } $HTML = substr($HTML, $EndOfFirstLine + 1); } else { if ($Debug) { echo "found NOTHING in cache for '{$category}/{$port}'<br>\n"; } $HTML = ''; $port_id = freshports_GetPortID($db, $category, $port); if (!isset($port_id)) { if ($Debug) { echo "{$category}/{$port} is not a port according to freshports_GetPortID<br>\n"; } return -1; } if ($Debug) { echo "{$category}/{$port} found by freshports_GetPortID<br>"; } $MyPort = new Port($db); $MyPort->FetchByID($port_id, $User->id); $port_display->port = $MyPort; $HTML .= $port_display->Display(); $HTML .= "</TD></TR>\n</TABLE>\n\n"; $HTML .= DisplayPortCommits($MyPort, $PageNumber); # If we are not reading if (!$BypassCache || $RefreshCache) { $Cache->CacheDataSet($MyPort->{'element_id'} . "\n" . $HTML); $Cache->AddPort($MyPort->category, $MyPort->port, CACHE_PORT_DETAIL, $PageNumber); } $ElementID = $MyPort->{'element_id'}; $OnWatchList = $MyPort->{'onwatchlist'}; } # At this point, we have the port detail HTML $HTML = $port_display->ReplaceWatchListToken($OnWatchList, $HTML, $ElementID); global $ShowAds, $BannerAd; global $ShowAds; global $BannerAd; if ($ShowAds && $BannerAd) { $HTML_For_Ad = "<hr><center>\n" . Ad_728x90PortDescription() . "\n</center>\n<hr>\n"; } else { $HTML_For_Ad = ''; } $HTML = $port_display->ReplaceAdvertismentToken($HTML, $HTML_For_Ad); freshports_ConditionalGetUnix($Cache->LastModifiedGet()); header("HTTP/1.1 200 OK"); $Title = $category . "/" . $port; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start($Title, "{$FreshPortsTitle} - new ports, applications", "FreeBSD, index, applications, ports"); ?> <?php echo freshports_MainTable(); ?> <tr><TD VALIGN="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText("Port details"); ?> </TR> <tr><td valign="top" width="100%"> <?php echo $HTML; ?> </TD> <TD VALIGN="top" WIDTH="*" ALIGN="center"> <?php echo freshports_SideBar(); ?> </td> </TR> </TABLE> <?php echo freshports_ShowFooter(); ?> </body> </html> <?php return 0; }
function freshports_NonPortDescription($db, $element_record) { global $TableWidth; global $FreshPortsTitle; $Debug = 1; freshports_ConditionalGet(freshports_LastModified()); header("HTTP/1.1 200 OK"); $Title = preg_replace('|^/?ports/|', '', $element_record->element_pathname); $FileName = preg_replace('|^/?ports/|', '', $element_record->element_pathname); require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start($Title, "{$FreshPortsTitle} - new ports, applications", "FreeBSD, index, applications, ports"); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText('non port: ' . $Title); ?> </TR> <tr><td> <a HREF="<?php echo FRESHPORTS_FREEBSD_SVN_URL . $element_record->element_pathname; ?> ?view=log">SVNWeb</a> </td></tr> <?php global $User; # these two options must be the last on the line. And as such are mutually exclusive define('BYPASSCACHE', 'bypasscache=1'); # do not read the cache for display define('REFRESHCACHE', 'refreshcache=1'); # refresh the cache $BypassCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(BYPASSCACHE)) == BYPASSCACHE; $RefreshCache = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["REQUEST_URI"]) - strlen(REFRESHCACHE)) == REFRESHCACHE; $PageNumber = 1; if (isset($_SERVER['REDIRECT_QUERY_STRING'])) { parse_str($_SERVER['REDIRECT_QUERY_STRING'], $query_parts); if (isset($query_parts['page']) && Is_Numeric($query_parts['page'])) { $PageNumber = intval($query_parts['page']); if ($PageNumber != $query_parts['page'] || $PageNumber < 1) { $PageNumber = 1; } } } $NumCommitsPerPage = $User->page_size; $Cache = new CacheFile(); $Cache->PageSize = $User->page_size; $result = $Cache->Retrieve($FileName, $PageNumber); if (!$result && !$BypassCache && !$RefreshCache) { if ($Debug) { echo "found something from the cache<br>\n"; } $HTML = $Cache->CacheDataGet(); # # we need to know the element_id of this port # and the whether or not it is on the person's watch list # let's create a special function for that! # $EndOfFirstLine = strpos($HTML, "\n"); if ($EndOfFirstLine == false) { die('Internal error: I was expecting an ElementID and found nothing'); } # extract the ElementID from the cache $ElementID = intval(substr($HTML, 0, $EndOfFirstLine)); if ($ElementID == 0) { syslog(LOG_ERR, "Extract of ElementID from cache failed. Is cache corrupt/deprecated? port was {$category}/{$port}"); die('sorry, I encountered a problem with the cache. Please send the URL and this message to the webmaster.'); } if ($User->id) { $OnWatchList = freshports_OnWatchList($db, $User->id, $ElementID); } else { $OnWatchList = 0; } $HTML = substr($HTML, $EndOfFirstLine + 1); } else { if ($Debug) { echo "found NOTHING in cache<br>\n"; } $HTML = ''; $Commits = new CommitsByTreeLocation($db); $Commits->SetLimit($Cache->PageSize); $Commits->Debug = $Debug; $Commits->UserIDSet($User->id); $Commits->TreePathConditionSet("= '" . $element_record->element_pathname . "'"); # # get the count without excuting the whole query # we don't want to pull back all the data. # $NumCommits = $Commits->GetCountCommits(); $params = array('mode' => 'Sliding', 'perPage' => $NumCommitsPerPage, 'delta' => 5, 'totalItems' => $NumCommits, 'urlVar' => 'page', 'currentPage' => $PageNumber, 'spacesBeforeSeparator' => 1, 'spacesAfterSeparator' => 1, 'append' => false, 'path' => '/' . preg_replace('|^/?ports/|', '', $element_record->element_pathname), 'fileName' => '?page=%d', 'altFirst' => 'First Page', 'firstPageText' => 'First Page', 'altLast' => 'Last Page', 'lastPageText' => 'Last Page'); $Pager =& Pager::factory($params); $links = $Pager->GetLinks(); $NumCommitsHTML = '<tr><td><p align="left">Number of commits found: ' . $NumCommits; $Offset = 0; $PageLinks = $links['all']; $PageLinksHTML = str_replace('/?page=1"', '"', $PageLinks); $PageLinksHTML = str_replace('/?page=', '?page=', $PageLinksHTML); if ($PageLinksHTML != '') { $offset = $Pager->getOffsetByPageId(); $NumOnThisPage = $offset[1] - $offset[0] + 1; $Offset = $offset[0] - 1; $NumCommitsHTML .= " (showing only {$NumOnThisPage} on this page)"; unset($offset); } if ($PageNumber > 1) { $Commits->SetOffset($Offset); } $NumCommitsHTML .= '</p>'; if ($PageLinksHTML != '') { $PageLinksHTML = '<p align="center">' . $PageLinksHTML . '</p>'; } $NumCommitsHTML .= $PageLinksHTML . '</td></tr>'; $HTML = $NumCommitsHTML; if ($Commits->Debug) { echo "PageNumber='{$PageNumber}'<br>Offset='{$Offset}'<br>"; } $NumFetches = $Commits->Fetch(); $DisplayCommit = new DisplayCommit($db, $Commits->LocalResult); $HTML .= $DisplayCommit->CreateHTML(); $HTML .= $NumCommitsHTML; # If we are not reading if (!$BypassCache || $RefreshCache) { $Cache->CacheDataSet($element_record->{'id'} . "\n" . $HTML); $Cache->Add($FileName, $PageNumber); } } echo $HTML; echo "</table>\n"; ?> </TD> <TD VALIGN="top" WIDTH="*" ALIGN="center"> <?php echo freshports_SideBar(); ?> </td> </TR> </TABLE> <?php echo freshports_ShowFooter(); ?> </body> </html> <?php }
<?php # # $Id: unrefreshed.php,v 1.2 2006-12-17 12:06:17 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../classes/ports-unrefreshed.php'; #$Debug=1; freshports_Start('Unrefreshed ports', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); #phpinfo(); function freshports_IfNull($Value1, $Value2 = ' ') { if (isset($Value1)) { $result = $Value1; } else { $result = $Value2; } return $result; } function freshports_DisplayUnrefreshedPorts($dbh) { global $User; $Ports = new PortsUnrefreshed($dbh); $NumRows = $Ports->FetchAll(); if ($NumRows > 0) { if ($User->type == SUPER_USER) {
<?php if (!defined("_COMMON_PHP")) { return; } # # $Id: header.php,v 1.2 2006-12-17 11:39:37 dan Exp $ # # Copyright (c) 1998-2005 DVL Software Limited # require $_SERVER['DOCUMENT_ROOT'] . "/../include/common.php"; require $_SERVER['DOCUMENT_ROOT'] . "/../include/freshports.php"; require $_SERVER['DOCUMENT_ROOT'] . "/../include/databaselogin.php"; require $_SERVER['DOCUMENT_ROOT'] . "/../include/getvalues.php"; freshports_Start('', '', '', 1); function custom_BannerForum($ForumName, $article_id) { $TableWidth = "100%"; echo '<TABLE WIDTH="' . $TableWidth . '" ALIGN="center" cellspacing="0">'; echo "\n <TR>\n <TD>\n <div class=\"section\">{$ForumName}</div>\n </TD>\n </TR>\n"; echo '</TABLE>'; } if ($BannerAd) { echo "\n<CENTER>\n"; echo Ad_728x90PhorumTop(); echo "</CENTER>\n\n"; } ?> <TABLE ALIGN="center" WIDTH="<?php
<?php # # $Id: welcome.php,v 1.2 2006-12-17 12:06:19 dan Exp $ # # Copyright (c) 1998-2003 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_Start('New User', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); $origin = $_GET["origin"]; ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText("Account created"); ?> </TR> <TR> <TD> <P>
<?php # # $Id: contact.php,v 1.1 2007-10-21 16:59:05 dan Exp $ # # Copyright (c) 2007 DVL Software Limited # require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/common.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/freshports.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/databaselogin.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/../include/getvalues.php'; freshports_ConditionalGet(freshports_LastModified()); freshports_Start('Contact', 'freshports - new ports, applications', 'FreeBSD, index, applications, ports'); ?> <?php echo freshports_MainTable(); ?> <tr><td valign="top" width="100%"> <?php echo freshports_MainContentTable(); ?> <TR> <?php echo freshports_PageBannerText('Contact'); ?> </TR> <TR><TD>