Location: PHPKode > projects > Ptk-forensics > ptk/lib/loggerClass.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
//include("check_session.php");
class AuditLog{
        function AuditLog($string){
                $user = sanitize(RemoveXSS($_SESSION['user']),PARANOID);
		if (empty($user)){
			$user = "Http request may be crafted";
		}

		$string = sanitize(RemoveXSS($string),PARANOID);
		if (empty($string)){
                        $string = "Http request may be crafted";
		}

		$ip = sanitize($_SESSION['ip'],PARANOID);
		if (empty($ip)){
                        $ip = "Http request may be crafted";
                }
  
                $timestamp = date('d/m/Y , H:i:s');
                $fp = fopen('../log/audit.log', 'a');
                fwrite($fp, $timestamp." , ".$user." , ".$ip." , ".$string."\n");
        }
}

class Log{
	function Log($ip, $user, $string){
		$user = sanitize(RemoveXSS($user),PARANOID);
		if (empty($user)){
                        $user = "Http request may be crafted";
                }

                $string = sanitize(RemoveXSS($string),PARANOID);
                if (empty($string)){
                        $string = "Http request may be crafted";
                }

                $ip = sanitize($_SESSION['ip'],PARANOID);
                if (empty($ip)){
                        $ip = "Http request may be crafted";
                }

		$timestamp = date('d/m/Y , H:i:s');
		if (isset($_SESSION['log'])){
			$fp = fopen($_SESSION['log'], 'a');
		}else{
	 		$fp = fopen('../log/audit.log', 'a');
		}
		fwrite($fp, $timestamp." , ".$user." , ".$ip." , ".$string."\n");
	}
}
?>
Return current item: Ptk-forensics