forked from MakaRax/HabboPHP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
62 lines (48 loc) · 1.84 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
#| #|
#| HABBOPHP - http://habbophp.com #|
#| Copyright © 2012 Arne Van Daele. All rights reserved. #|
#| #| #|
#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|
session_start();
define('CORE','CORE');
require'includes/core.php';
if(extension_loaded('curl'))
require 'class/facebook.php';
if($Auth->isConnected()) redirection($config->url_site.'/me.php');
$config->checkMaintenance();
$Error = new Error();
if(isset($_POST['username'])){
if(isset($_POST['username']) && empty($_POST['username']))
$Error->set('pseudo',$tpl->assign('error_login_pseudo','true'));
if(isset($_POST['password']) && empty($_POST['password']))
$Error->set('password',$tpl->assign('error_login_password','true'));
if(!$Error->ErrorPresent()){
if($Auth->connexion($_POST)){
redirection($config->url_site.'/me.php');
}else{
$Error->set('AuthFalse',$tpl->assign('error_login_wrong','true'));
}
}
}
if(isset($_GET['ban']) && is_numeric($_GET['ban'])){
$isBan = $db->query('SELECT * FROM bans WHERE id="'.safe($_GET['ban'],'SQL').'"',true,false);
if($isBan){
$tpl->assign('error_ban','true');
$tpl->assign('reason',$isBan['reason']);
$tpl->assign('expire',date('d/m/Y H:i:s',$isBan['expire']));
}
}
if(isset($_GET['error'])){
switch($_GET['error']){
case 'token' :
$tpl->assign('error_get',$tpl->getConfigVars('error_token'));
break ;
}
}
$tpl->assign('token',Tools::generate_token());
//L'index-v2 est supprimé suite à des problèmes de performances, si vous êtes en local, vous pouvez l'utiliser, sinon ne l'utilisez pas.
$tpl->display('index.tpl');
//$tpl->display('index-v2.tpl');
?>