MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require_once '../functions.php'; require_once './luser_functions.php'; require_once 'Pager.php'; require_once '../filter.inc'; session_start(); //authenticate(); $luser = $_SESSION['luser']; $pass = $_SESSION['pass']; if (!luser_auth($luser, $pass)) { echo "Error: You are not logged in - please \n"; echo "<a href=\"luser_login.php\">log in</a> first.\n"; html_end(); exit; } // $myfilter = " and ( to_address=\"".$luser."\" "; $myfilter = " and (to_address=\"" . $luser . "\" or from_address=\"" . $luser . "\") "; // I don't know why the following line causes things to puke. :-( // $myfilter = " and (timestamp>(now() - interval 3 day)) and (to_address=\"".$luser."\" or from_address=\"".$luser."\") "; $refresh = luser_html_start("Message Listing"); $dbh = DB::connect(DB_DSN, true); if (DB::isError($dbh)) { die($dbh->getMessage()); } $sth = $dbh->query("\n SELECT\n DATE_FORMAT(timestamp, '%d/%m/%y %H:%i:%s') AS datetime,\n id AS id,\n from_address,\n to_address,\n subject,\n size,\n CASE WHEN isspam=1 THEN 'Y' ELSE 'N' END AS isspam,\n CASE WHEN ishighspam=1 THEN 'Y' ELSE 'N' END AS ishighspam,\n CASE WHEN isrblspam=1 THEN 'Y' ELSE 'N' END AS isrblspam,\n CASE WHEN spamwhitelisted=1 THEN 'Y' ELSE 'N' END AS iswhitelisted,\n sascore,\n CASE WHEN virusinfected=1 THEN 'Y' ELSE 'N' END AS virusinfected,\n CASE WHEN nameinfected=1 THEN 'Y' ELSE 'N' END AS nameinfected,\n CASE WHEN otherinfected=1 THEN 'Y' ELSE 'N' END AS otherinfected,\n report\n FROM\n maillog\n WHERE\n 1=1\n " . $myfilter . "\n ORDER BY \n date DESC, time DESC\n") or die("Error executing query: " . mysql_error());
default: // Unrecognized reqtype. echo "Error: Unrecognized request type (" . $reqtype . ")\n<br>\n"; luser_loginfailed(); exit; } // echo "Reqtype: $reqtype\n<br>\n"; // echo "Luser: $user\n<br>\n"; // echo "Pass: $pass\n<br>\n"; debug("Reqtype: {$reqtype}\n<br>\n"); debug("Luser: {$user}\n<br>\n"); debug("Pass: {$pass}\n<br>\n"); if (luser_exists($user)) { debug("User exists: {$user}\n<br>\n"); } if (luser_auth($user, $pass)) { debug("Password valid: {$pass}\n<br>\n"); } if ($logged_in) { print_successpage(); exit; } else { luser_loginform(); } function print_successpage() { $refresh = luser_loginstart("Login"); echo "<div align=\"center\">\n"; echo "<TABLE width=\"400\" CLASS=\"mail\" BORDER=0 WIDTH=100% CELLSPACING=2 CELLPADDING=2>\n"; echo " <THEAD>\n"; echo " <TH COLSPAN=2>Thank you - you are now logged in.</TH>\n";