<?php
/*===================================================+ 
|| # HoloCMS - Website and Content Management System
|+===================================================+ 
|| # Copyright © 2012 DnT [Tutti i diritti riservati]
|| # http://dnt.webnet32.com/
|+===================================================+ 
|| # DnT HoloCMS v2.1 - Created By Donatello (DnT)
|| # http://code.google.com/p/dnt-project/downloads/list
|+===================================================*/ 

include('core.php');

session_start();


include("locale/".$language."/login.php");


if(!session_is_registered(username)){

	if(isset($_POST['username']) && isset($_POST['password'])){
		$username = addslashes($_POST['username']);
			$sql = mysql_query("SELECT * FROM users WHERE username = '".$username."' LIMIT 1") or die(mysql_error());
			$row2s = mysql_fetch_array($sql);
		$password = HoloHash($_POST['password'], $row2s[username]);
		$remember_me = FilterText($_POST['_login_remember_me']);

		if(empty($username) || empty($password)){
			$login_error = "Perfavore non lasciare spazi bianchi.";
		}	else {
			$sql = mysql_query("SELECT id FROM users WHERE username = '".$username."' AND password = '".$password."' LIMIT 1") or die(mysql_error());
			$rows = mysql_num_rows($sql);
			if($rows < 1){
				$login_error = "Username o Password errati";
			} else {
				$userdata = mysql_fetch_assoc($sql);
				$userid = $userdata['id'];
				
				$is_banned = mysql_num_rows($check);
				if($is_banned < 1){
					$_SESSION['username'] = $username;
					$_SESSION['password'] = $password;
					if($remember_me == "true"){
						setcookie("remember", "remember", time()+60*60*24*100, "/");
						setcookie("rusername", $_SESSION['username'], time()+60*60*24*100, "/");
						setcookie("rpassword", sha1("zomq".$_SESSION['password']), time()+60*60*24*100, "/");
					}
					$sql3 = mysql_query("UPDATE users SET lastvisit = '".$date_full."' WHERE username = '".$username."'") or die(mysql_error());
					header("location:security_check"); exit;
				} else {
					$bandata = mysql_fetch_assoc($check);
					$reason = $bandata['reason'];
					$expire = $bandata['expire'];


					if($stamp_now < $stamp_expire){
						$login_error = "<center>Sei stato bannato per il seguente motivo: \"".$reason."\".<br>Il tuo BAN scade il: ".$expire.".</center>";
					} else { // ban expired
						//mysql_query("DELETE FROM users_bans WHERE userid = '".$userid."' OR ipaddress = '".$remote_ip."' LIMIT 1") or die(mysql_error());
						$_SESSION['username'] = $username;
						$_SESSION['password'] = $password;
						if($remember_me == "true"){
							setcookie("remember", "remember", time()+60*60*24*100, "/");
							setcookie("rusername", $_SESSION['username'], time()+60*60*24*100, "/");
							setcookie("rpassword", sha1("zomq".$_SESSION['password']), time()+60*60*24*100, "/");
						}
						$sql3 = mysql_query("UPDATE users SET lastvisit = '".$date_full."' WHERE username = '".$username."'") or die(mysql_error());
						header("location:security_check"); exit;
					}
				}
			}
		}
	}

	
	
	
	
	
	
	if(isset($_GET['error'])){
		$errorno = $_GET['error'];
		if($errorno == 1){
			$login_error = "Username o Password errati";
		} elseif($errorno == 2){
			$login_error = "Username o Password errati";
		} elseif(isset($_GET['ageLimit']) && $_GET['ageLimit'] == "true"){
			$login_error = "Sei troppo giovane per Giocare Qui.";
		}

	}


	include("locale/".$language."/login.php");
	
?>


<!-- Habbo Index by Crookie | MADE FOR FANS -->
<!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" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title><?php echo $sitename; ?>: Benvenuto!</title>

	<meta name="description" content="DnT HoloCMS v2 - Created By Donatello (DnT)" />
	<meta name="keywords" content="dnt cms retros" />

<link rel="shortcut icon" href="../favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="stylesheet" href="data/css/frontpage.css" type="text/css" />
<script src="data/js/libs2.js" type="text/javascript"></script>
<script src="data/js/landing.js" type="text/javascript"></script>
<script src="data/js/visual.js" type="text/javascript"></script>
<script src="data/js/libs.js" type="text/javascript"></script>
<script src="data/js/common.js" type="text/javascript"></script>
<script src="data/js/fullcontent.js" type="text/javascript"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>

<link rel="stylesheet" href="data/css/style.css" type="text/css" />
<script type="text/javascript" src="data/js/modernizr.custom.28468.js"></script>
<link href='http://fonts.googleapis.com/css?family=Economica:700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="data/css/box.css" />

<form id="loginformitem" name="loginformitem" action="/index.php?name=true&password=true"
          method="post">
<?php if(isset($login_error)){ ?>
        <div id="loginerrorfieldwrapper">
            <div id="loginerrorfield">
            <div><?php echo $login_error; ?></div>
            </div> </div> <?php } elseif($_SESSION['CHANGE_YES'] != ''){	
		?> <div id="loginerrorfieldwrapper">
            <div id="loginerrorfield">
            <div>La tua password e' stata modificata correttamente.</div>
            </div> </div> 
			<?php
				unset($_SESSION['CHANGE_YES']);
		}
		?>

<style type="text/css">
            body {
                 background-color: #000000;
                
            }
            #footer .footer-links   { color: #666666; }
            #footer .footer-links a { color: #ffffff; }
            #footer .copyright      { color: #666666; }
            #footer #compact-tags-container span, #footer #compact-tags-container a { color: #333333; }
        </style>
</head>



<body id="frontpage">

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




<div id="site-header">


 <form id="register_form" name="loginformitem" action="<?php echo $path; ?>?name=<?php echo FilterText($_POST['username']); ?>&password=true" method="post">



    



        <div style="clear: both;"></div>

        <div id="site-header-content">

            <div id="habbo-logo"></div>

            <div id="login-form">


                <div id="login-form-email">
                    <label for="login-username"
                           class="login-text">Username</label>
                    <input tabindex="3" type="text" class="login-field" name="username" id="login-username"
                           value="" maxlength="48"/>
                    <input tabindex="6" type="checkbox" name="_login_remember_me" id="login-remember-me"
                           value="true"/>
                    <label for="login-remember-me">Ricordami</label>

<div id="landing-remember-me-notification" class="bottom-bubble" style="display:none;">
	<div class="bottom-bubble-t"><div></div></div>
	<div class="bottom-bubble-c">
                
	</div>
	<div class="bottom-bubble-b"><div></div></div>
</div>

                </div>

                <div id="login-form-password">
                    <label for="login-password" class="login-text">Password</label>
                    <input tabindex="4" type="password" class="login-field" name="password"
                           id="login-password" maxlength="32"/>

                    <div id="login-forgot-password">
                        <a href="../quickregister/forgot" id="forgot-password"><span>Password dimenticata?</span></a>
                    </div>
                </div>

<div id="login-form-submit">
                            <input type="submit" value="Entra" name="login">
                        </div>


            </div>

<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
Cookie.erase("fbsr_309555212435126");
$(document).fire("fbevents:scriptLoaded");
};
window.assistedLogin = function(FBobject, optresponse) {
Cookie.erase("fbsr_1309555212435126");
FB.init({
appId: '<?php echo APP_ID; ?>', 
status: true, 
cookie: true, 
xfbml: true, 
oauth: true
});
permissions = 'user_birthday,email';
defaultAction = function(response) {
if (response.authResponse) {
fbConnectUrl = "/facebook/index.php?connect=true";
Cookie.erase("fbhb_val_309555212435126");
Cookie.set("fbhb_val_309555212435126", response.authResponse.accessToken);
Cookie.erase("fbhb_expr_309555212435126");
Cookie.set("fbhb_expr_309555212435126", response.authResponse.expiresIn);
window.location.replace(fbConnectUrl);
}
};
if (typeof optresponse == 'undefined')
FB.login(defaultAction, {scope:permissions});
else
FB.login(optresponse, {scope:permissions});
};
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/it_IT/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>		
			
            <div id="rpx-login">
                <div>

<a class="fb_button fb_button_large" href="http://dnt.webnet32.com/FacebookLogin/" return false;">
    <span class="fb_button_text">Entra con Facebook</span>
</a>
<P ALIGN=LEFT><img src="/web-gallery/funon.png" width="151" height="27" /></P>

                </div>

             

            </div>

<noscript>
<div id="alert-javascript-container">
    <div id="alert-javascript-title">
        Missing JavaScript support
    </div>
    <div id="alert-javascript-text">
        Javascript is disabled on your browser. Please enable JavaScript or upgrade to a Javascript-capable browser to use <?php echo $sitename; ?> :)
    </div>
</div>
</noscript>

<div id="alert-cookies-container" style="display:none">
    <div id="alert-cookies-title">
        Missing cookie support
    </div>
    <div id="alert-cookies-text">
        Cookies are disabled on your browser. Please enable cookies to use <?php echo $sitename; ?>.
    </div>
</div>


        </div>

    </form>

</div>
<div id="fp-container">
    <div id="content">
    <div id="column1" class="column">
			     		
				<div class="habblet-container ">		
	
						<div style="width: 890px; margin: 0 auto">
       <div id="tagline" style="padding: 4px 60px 15px;">Incontra nuovi Amici, divertiti e fatti conoscere! <a  href="./quickregister/"><img style="margin-left:35px;cursor: pointer;position:absolute;" src="data/images/enbutton.png" onmouseover="this.src='data/images/enbutton2.png'" onmouseout="this.src='data/images/enbutton.png'"></a></div>
</div>



<div id="frontpage-image-container">

    <div id="people-inside">
        <b><span><span class="stats-fig"><?php echo $online_count; ?></span> Online Ora!</span></b>
        <i></i>
    </div>


<table width="486"align=left cellspacing="0" cellpadding="0">
<tbody><tr><td><div id="oberteil">Stanze Ufficiali</div>

			<div id="da-slider" class="da-slider">
				<div class="da-slide">
		 
					<div class="da-img" ><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/library.png" /></div>
  <div class="titel">Helpers
       </div>
				</div>





				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/piknik.png" /></div>

  <div class="titel">Picnic
       </div>
				</div>




				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/lido.png"/></div>

  <div class="titel">Lido
       </div>

				</div>




	<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/niko.png"/></div>

  <div class="titel">Niko
       </div>


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

</td>

<td><div id="oberteil">Stanze Quest</div>

			<div id="da-slider2" class="da-slider">
				<div class="da-slide">
					
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/beach.png"/></div>
  <div class="titel">Spiaggia
       </div>
				</div>
				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/bar.png"/></div>
  <div class="titel">Bubble Bar
      </div>
				</div>
				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/pet.png"/></div>
  <div class="titel">Parco
       </div>
				</div>
	<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/rare.png"/></div>
  <div class="titel">Museo
       </div>
				</div>
	
			
			</div>
        </div>

</td>


<td><div id="oberteil">Stanze Giochi</div>

			<div id="da-slider3" class="da-slider">
				<div class="da-slide">
					
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/banzai.png"/></div>
  <div class="titel">Battle Banzai
       </div>
				</div>
				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/tic.png"/></div>
  <div class="titel">Tic Tac Toe
      </div>
				</div>
				<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/knacker.png"/></div>
  <div class="titel">Labirinti
      </div>
				</div>
	<div class="da-slide">
					<div class="da-img"><img style="border-radius:14px 14px 14px 14px;cursor: pointer;" onclick="window.location='./quickregister/'" src="data/images/extra/freeze.png"/></div>
  <div class="titel">Freeze Arena
       </div>
				</div>
	
			
			</div>
        </div>

</td>


</tr></div>
</tbody></table>



<table width="400" cellspacing="0" cellpadding="0">
<tr>
<td id="box1">
<img style="border-radius:14px 14px 14px 14px;" src="data/images/game.png" height="30" width="50" align="left" hspace=10 vspace=10><div style="font-size:18px;"><b>GIOCHI</b></div>
<p style="width:250px;">Entra in <?php echo $sitename; ?> , divertiti e <font color="#FFBF00"><u>Gioca</font></u> con i tuoi amici</p>
</td>


<td id="box2">
<img style="border-radius:14px 14px 14px 14px;" src="data/images/design.png" height="40" width="60" align="left" hspace=5 vspace=15><div style="font-size:18px;"><b>DESIGN</b></div>
<p style="width:320px;">Pareti rosa, pavimento rosso, giardino verde? Crea la tua stanza, come vuoi tu.</p>
</td>

<td id="box3"><div style="position: absolute;left:70px;top:10px;width:220px;"><b><div style="font-size:18px;">CHAT</b></div>Incontra nuovi amici, divertiti con loro e diventa famoso!</div>
<img style="position:absolute;float:left; margin:0px 5px 30px 0px;background:left center;z-index:-1;" src="data/images/right.png">
</td>

<td id="box3"><div style="position: absolute;left:100px;top:112px;width:270px;"><img src="data/images/people.png"></td>

</tr>
</tbody></table>


<script type="text/javascript" src="data/js/jquery.min.js"></script>
		<script type="text/javascript" src="data/js/slider.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$('#da-slider').cslider();
				
			});
			$(function() {
			
				$('#da-slider2').cslider();
				
			});

			$(function() {
			
				$('#da-slider3').cslider();
				
			});

		</script>	




</div>



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

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


<div id="footer" class="new_and_improved">
<p class="footer-links"><font color="white">
<a href="http://dnt.webnet32.com/">DnT WebSite</a> | <a href="http://code.google.com/p/dnt-project/downloads/list">DnT Project</a> | <a href="http://dnt-official.forumfree.it/">Forum</a> | <a href="http://www.facebook.com/groups/144401245615436/">FaceBook</a> | <a href="http://dnt.webnet32.com/PROMOZIONI/">Promozioni</a> | <a href="./rules">Regolamento</a> | <a href="./staff">Staff</a>
</p></font>



        <div id="habbo-logo-footer"></div>
<p class="copyright"><b>DnT HoloCMS v2.1</b> &copy 2012 Created By <b>Donatello (DnT)</b><br />Non facciamo parte di HABBO o della Sulake Group.</p>




</div>
    </div>
</div>
<?php


} else {
header("location:me");
}

?>

</body></html>