Location: PHPKode > projects > Ptk-forensics > ptk/lib/delete_report.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
include("sanitize.php");
include ("loggerClass.php");
session_start();
$token_age = time() - $_SESSION['rep_token_time'];
if (!isset($_SESSION['rep_token']) or strcmp($_SESSION['user'],"admin")!=0 or strcmp($_SESSION['rep_token'],$_GET['tk'])!=0 or $token_age > 300){
	new AuditLog('Unauthorized access to delete_report '.sanitize($_GET['name'],PARANOID));
        header("location: goto_home.php");
}else{
	$name = stripslashes(RemoveXSS($_GET['name']));
	$name = charset_decode_utf_8($name);
	$pattern = '/(\/|;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i';
        $name = preg_replace($pattern, "", $name);
	unlink("../report/$name");

	session_start();
	new Log($_SESSION['ip'], $_SESSION['user'], 'Report deleted');

	header("location: analysis_report.php");
}
?>
Return current item: Ptk-forensics