<?PHP
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
#|                                                                        #|
#|         JabboCMS - Website and Content Management System               #|
#|         Copyright © 2011 Jor.dan. All rights reserved.                 #|
#|																		  #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
@session_start();

	@include("./includes/MySQL.php");
	@include("../includes/MySQL.php");
	@include("./includes/CMS.php");
	@include("../includes/CMS.php");
	@include("./includes/Function.php");
	@include("../includes/Function.php");
	
	if(session_is_registered(username))
		{
			$username = Securise($_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 {
				session_destroy();
				Redirect("".$url."");
				exit();
				}
		}
	
?>