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

	include("./global.php");
	$pagename = "Accueil";
    $pageid = "index";
if(session_is_registered(username))
	{
		Redirect("".$url."/surcharge.php");
	}
	
	$do = Securise($_GET['do']);

		if($do == "process_login")
			{
				if(isset($_POST['username']) && isset($_POST['password']))
					{
						$username = Securise($_POST['username']);
						$password = JabboHash($_POST['password']);
						
							if(empty($username) || empty($password))
								{
										$erreur = "Merci de remplir les champs vide.";
								}
							else 
									{
										$sql = mysql_query("SELECT id,disabled FROM users WHERE username = '".$username."' AND password = '".$password."' LIMIT 1") or die(mysql_error());
										$row = mysql_num_rows($sql);
										$assoc = mysql_fetch_assoc($sql);
										
							if($row < 1)
									{
										$erreur = "Pseudo ou Mot de Passe invalide.";
									}
							else
									{
										
										if($assoc['disabled'] == 1)
											{
												$erreur = "Ton compte &agrave; &eacute;tait d&eacute;sactiv&eacute; par un Admnistrateur. En cas d'erreur de notre part merci de nous contacter &agrave; contact@jabbo.eu";
											}
										else
										{
										$sql = mysql_query("SELECT * FROM bans WHERE value = '".$username."'");
										$b = mysql_fetch_assoc($sql);
										$row_ban = mysql_num_rows($sql);
										
										
									$stamp_now = mktime(date('H:i:s d-m-Y'));
									$stamp_expire = $b['expire'];
									$expire = date('d/m/Y H:i:s', $b['expire']);
									
									if($stamp_now < $stamp_expire){
									$erreur = "Ton compte &agrave; &eacute;tait bannis pour la raison suivante:<br> <b>".utf8_decode($b['reason'])."</b>. Il expira le: <b>".$expire."</b>";
																} else {
									if($row_ban > 0) {
										mysql_query("DELETE FROM bans WHERE value = '".$username."'");
									}
										mysql_query("UPDATE users SET last_offline = '".FullDate('full')."' WHERE username = '".$username."'");
										$_SESSION['username'] = $username;
										$_SESSION['password'] = $password;
										Redirect("".$url."/surcharge.php");
																		}
										}
									}
											
									}
					}
			}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=ISO 5589-1" />
	<title><?PHP echo $sitename; ?>: <?PHP echo $pagename; ?></title>

<script type="text/javascript">
var andSoItBegins = (new Date()).getTime();
</script>

<script src="<?PHP echo $imagepath; ?>static/js/visual.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/libs.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/common.js" type="text/javascript"></script>

<script src="<?PHP echo $imagepath; ?>static/js/fullcontent.js" type="text/javascript"></script>
<script src="<?PHP echo $imagepath; ?>static/js/libs2.js" type="text/javascript"></script>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/style.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/buttons.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/boxes.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/tooltips.css" type="text/css" />
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/process.css" type="text/css" />

<script type="text/javascript">
document.habboLoggedIn = false;
var habboName = null;
var habboReqPath = "";
var habboStaticFilePath = "./web-gallery";
var habboImagerUrl = "/habbo-imaging/";
var habboPartner = "";
window.name = "habboMain";

</script>



<meta name="description" content="<?PHP echo $description; ?>" />
<meta name="keywords" content="<?PHP echo $keyword; ?>" />

<!--[if lt IE 8]>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/ie.css" type="text/css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" href="<?PHP echo $imagepath; ?>v2/styles/ie6.css" type="text/css" />
<script src="<?PHP echo $imagepath; ?>static/js/pngfix.js" type="text/javascript"></script>
<script type="text/javascript">
try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
</script>

<style type="text/css">
body { behavior: url(<?PHP echo $imagepath; ?>csshover.htc); }
</style>
<![endif]-->
<meta name="build" content="<?PHP echo $build; ?> >> <?PHP echo $version; ?>" />
</head>
<body id="landing" class="process-template">

<div id="overlay"></div>

<div id="container">
	<div class="cbb process-template-box clearfix">
		<div id="content">
			<div id="header" class="clearfix">
				<h1><a href="<?PHP echo $url; ?>"></a></h1>

			</div>			<div id="process-content">
	        	<div id="column1" class="column">
				<div class="habblet-container " id="create-habbo">

						<div id="create-habbo">
	<div id="create-habbo-nonflash">

        <div id="landing-register-text"><a href="<?PHP echo $url; ?>/register.php"><span>Inscris-toi gratuitement!</span></a></div>
        <div id="landing-promotional-text"><span><?PHP echo $sitename; ?> est un monde virtuel o&ugrave; tu feras des rencontres et des amis.</span></div>
    </div>
</div>



				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

</div><div id="column2" class="column">
				<div class="habblet-container ">

				<?PHP if(isset($erreur)) { echo "<div class=\"action-error flash-message\"><div class=\"rounded\">  <ul> <li>".$erreur."</li>  </ul></div>\n</div>"; } ?>
						<div class="cbb loginbox clearfix">
    <h2 class="title">Se connecter</h2>

    <div class="box-content clearfix" id="login-habblet">
        <form action="<?PHP echo $url; ?>/index.php?do=process_login" method="post" class="login-habblet">
		
            <ul>

                <li>
                    <label for="login-username" class="login-text">Pseudo</label>
                    <input tabindex="1" type="text" class="login-field" name="username" id="login-username" value="" />
                </li>
                <li>
                    <label for="login-password" class="login-text">Mot de Passe</label>
                    <input tabindex="2" type="password" class="login-field" name="password" id="login-password" />
	                    <input type="submit" value="Sign in" class="submit" id="login-submit-button"/>

	                    <a href="#" id="login-submit-new-button" class="new-button" style="float: left; margin-left: 0;display:none"><b style="padding-left: 10px; padding-right: 7px; width: 55px">Entrer</b><i></i></a>
                </li>
                <li class="no-label">
                    <input tabindex="3" type="checkbox" name="_login_remember_me" id="login-remember-me" value="true"/>
                    <label for="login-remember-me">Se souvenir de moi</label>
                </li>
                <li class="no-label">
                    <a href="<?PHP echo $url; ?>/register.php" class="login-register-link"><span>Inscris-toi gratuitement!</span></a>

                </li>
                <li class="no-label">
                    <a href="<?PHP echo $url; ?>/forgot.php" id="forgot-password"><span>J'ai oubli&eacute; mon Pseudo/Passe</span></a>
                </li>
            </ul>
        </form>

    </div>
</div>

<div id="remember-me-notification" class="bottom-bubble" style="display:none;">
	<div class="bottom-bubble-t"><div></div></div>
	<div class="bottom-bubble-c">
	Cette option &agrave; &eacute;tait d&eacute;sactiv&eacute;.
	</div>
	<div class="bottom-bubble-b"><div></div></div>
</div>
<script type="text/javascript">
	HabboView.add(LoginFormUI.init);
	HabboView.add(RememberMeUI.init);
</script>



								</div>

				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

				<div class="habblet-container ">

						<div class="ad-container">
<div id="geoip-ad" style="display:none"></div>
</div>



				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

				<div class="habblet-container ">





				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

				<div class="habblet-container ">

						<div class="ad-container">
<a href="<?PHP echo $url; ?>/register.php"><img src="<?PHP echo $imagepath; ?>v2/images/landing/uk_party_frontpage_image.gif" alt="" /></a>
</div>
	
						
					
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
			 

</div>
<div id="column3" class="column">

</div>
						
					
				</div>
				<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>

			 
 
<!--[if lt IE 7]>
<script type="text/javascript">
Pngfix.doPngImageFix();
</script>
<![endif]-->

<!--[if lt IE 7]>
<script type="text/javascript">
Pngfix.doPngImageFix();
</script>
<![endif]-->

<!-- FOOTER -->
<?PHP include("./template/footer.php"); ?>
<!-- FIN FOOTER -->

		</div>
        </div>
    </div>
</div>

<script type="text/javascript">
HabboView.run();
</script>


</body>

</html>