<?php
/*  
 * Analysis Console for Intrusion Databases (ACID)
 *
 * Author: Roman Danyliw <rdd@cert.org>, <roman@danyliw.com>
 *
 * Copyright (C) 2000, 2001 Carnegie Mellon University
 * (see the file 'acid_main.php' for license details)
 *
 * Purpose: debugging and logging routines   
 *
 */

function ErrorMessage ($message)
{
   echo '<FONT COLOR="#FF0000">'.$message.'</FONT><P>';
}

function FatalError ($message)
{
   echo '<FONT COLOR="#FF0000"><B>ACID FATAL ERROR:</B> '.$message.'</FONT>';
   die();  
}

function PrintServerInformation()
{
   echo '';
}

function PrintPageHeader()
{
     GLOBAL $PHP_SELF, $HTTP_REFERER, $QUERY_STRING,
            $HTTP_USER_AGENT, $SERVER_SOFTWARE, $DBtype, $ADODB_vers,
            $HTTP_SESSION_VARS;

   $tmp = session_encode();   
  
   echo "<PRE>
         <B>URL:</B> '$PHP_SELF' (<B>referred by:</B> '$HTTP_REFERER')
         <B>PARAMETERS:</B> '$QUERY_STRING'
         <B>CLIENT:</B> $HTTP_USER_AGENT
         <B>SERVER:</B> $SERVER_SOFTWARE 
         <B>SERVER HW:</B> ".php_uname()."
         <B>DATABASE TYPE:</B> $DBtype  <B>DB ABSTRACTION VERSION:</B> $ADODB_vers
         <B>PHP VERSION:</B> ".phpversion()."  <B>PHP API:</B> ".php_sapi_name()."
         <B>SESSION ID:</B> ".session_id()."( ".strlen($tmp)." bytes )
         </PRE>";
}

function PrintHTTPPost()
{
   GLOBAL $HTTP_POST_VARS;

   echo "<BR><B>HTTP POST Variables</B><PRE>";
   print_r($HTTP_POST_VARS);
   echo "</PRE>";
}

?>
