-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.php
77 lines (66 loc) · 1.8 KB
/
global.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
if((@ini_get('register_globals') || !@ini_get('gpc_order')) && (isset($_POST) || isset($_GET) || isset($_COOKIE)))
{
foreach(array_keys($_POST+$_GET+$_COOKIE+$_SERVER+$_FILES) as $key)
{
$$key='';
unset($$key);
$$key='';
}
}
if(isset($_POST['GLOBALS'])||isset($_GET['GLOBALS'])||isset($_FILES['GLOBALS'])||isset($_COOKIE['GLOBALS'])||isset($_REQUEST['GLOBALS'])||isset($_ENV['GLOBALS']))
{
die('Hacking attempt !!<br>you cant make your own global variables :)');
}
DEFINE("_PREFIX_",'',1);
require('./includes/functions.php');
require('./includes/class_db.php');
require('./includes/class_templates.php');
require('./includes/config.php');
$TP = new templates;
$DB = new dbclass;
$dbconnect = $DB->connect($server,$username,$password);
if(!$dbconnect)
{
Die('U OR P To DB');
}
$dbselect = $DB->selectdb($dbname,$dbconnect);
if(!$dbselect)
{
Die('DB');
}
$tmps='page,redirection,closed,error,nav_user,nav_login';//,main,right_side,right_side_bit,left_side,left_side_bit';
$usedtemplates=($usedtemplates)?$usedtemplates.','.$tmps:$tmps;
$TP->templatesused($usedtemplates);
$menublocks='';
$linksblocks='';
$right_first='';
$right_second='';
$query=$DB->query("select * from setting");
while($r=$DB->fetch_array($query))
{
$setting[$r[title]]=$r[value];
}
$TP->ass('setting',$setting);
if($setting['onoff']==1)
{
$TP->ass('message',$setting['message']);
die($TP->GetTemp('closed'));
}
$user=checklogin($_COOKIE['email'],$_COOKIE['pass']);
$tab='';
if($user['id'] > 0)
{
$user['date']=mydate($user['joindate'],'last');
$TP->ass('user',$user);
$tab=$TP->gettemp('nav_user');
}
else
{
$user['id']=0;
$tab=$TP->gettemp('nav_login');
}
//print_r($user);
//die($tab);
$TP->ass('nav_tab',$tab);
?>