<?PHP
/********************************************************************************+\
** -+- LeetWEB Last Edition ~ The way to run a private server
*+*******************************************************************************
** -+- Copyright (C) 2011 Nilz. All rechten worden voorbehouden
** -+- http://www.leethotel.com
**
** -+- Parts Copyright (C) 2011 Joopie. All rechten worden voorbehouden
** -+- http://www.jospiek.nl
\+*******************************************************************************/
@session_start();

@include("/MySQL.php");
@include("./MySQL.php");
@include("/Config.php");
@include("./Config.php");
@include("/Functions.php");
@include("./Functions.php");

$users = new Register();
$row = 0;

	if(isset($_SESSION['username']))
	{
		$username = Filter($_SESSION['username']);
		$sql = mysql_query("SELECT * FROM `users` WHERE `username` = '".$username."' LIMIT 1") or die(mysql_error());
		$row = mysql_num_rows($sql);
	}

	if($row > 0)
	{
		$user = mysql_fetch_assoc($sql);
		mysql_query("UPDATE `users` SET `ip_last` = '".$_SERVER["REMOTE_ADDR"]."' WHERE `id` = '".$user['id']."'");
	}
		else
{
	if (isset($must_login))
	{
		session_destroy();
		Redirect($path);
		exit();
	}
}
?>