function FetchByCookie($Cookie) { $sql = "SELECT users.*\n\t\t FROM users\n\t\t\t\t WHERE cookie = '{$Cookie}'"; $this->LocalResult = pg_exec($this->dbh, $sql); if ($this->LocalResult) { $numrows = pg_numrows($this->LocalResult); if ($numrows == 1) { $myrow = pg_fetch_array($this->LocalResult, 0); $this->PopulateValues($myrow); } else { freshports_CookieClear(); syslog(LOG_ERR, "Could not find user details for '{$Cookie}' from '" . $_SERVER['REMOTE_ADDR'] . "' for '" . $SERVER['REQUEST_URI'] . "'."); die('Your user details were not found. You have been logged out. Please reload this page.'); } } else { $numrows = -1; syslog(LOG_ERR, __FILE__ . '::' . __LINE__ . ': ' . pg_last_error()); die('something terrible has happened'); } return $numrows; }
<?php # $Id: logout.php,v 1.3 2011-10-02 18:58:36 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'; freshports_CookieClear(); if (isset($_GET['origin'])) { $origin = $_GET['origin']; } else { $origin = ''; } if ($origin == '/index.php') { $origin = ''; } header("Location: /{$origin}"); /* Redirect browser to PHP web site */ exit; /* Make sure that code below does not get executed when we redirect. */ ?> <html> <head> <title></title> </head> <body> </body>