-
Notifications
You must be signed in to change notification settings - Fork 1
/
global.php
executable file
·69 lines (55 loc) · 1.72 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
<?php
/*
Code written and managed by Dario Magliocchetti-Lombi for e.quinox
Copying is under no circumstances allowed, unless prior WRITTEN (not email) consent from author.
COPY 2011-2012, dario-ml
www.dario-ml.com
Page Name: core.php
Description: Holds the core variables for most of the script!
*/
session_start();
if (!defined("SAFE_ZONE"))
{
echo "Fatal Error : Not called from Safe Zone!";
exit();
}
if (@$_GET['do'] == "logout")
{
session_destroy();
header("Location: index.php");
}
include("inc/core.php");
$core->LoginFunctions();
///////////////////////
///////////////////////
$test = bindec('111111');
$test = decbin($test);
$test = strrev($test);
$_SESSION['equinox_code_permission'] = $test;
$twig->addGlobal('__permission', $test);
///////////////////////
///////////////////////
//Unload pages if not allowed to see!
if (@$_SESSION['equinox_code_shops'] == array(0=>0) && @$_SESSION['equinox_code_permission'][1] != 1)
{
//Not allowed to view customers!
unset($core->links["customers.php"]);
}
if (@$_SESSION['equinox_code_permission'][0] != 1)
{
unset($core->links["admin.php"]);
}
if ($core->getPermission(2) != 1)
{
unset($core->links['admin.php']['subpages']['newcust']);
}
if ($core->getPermission(3) != 1)
{
unset($core->links['admin.php']['subpages']['editcus']);
}
$twig->addGlobal('__corelinks', $core->links);
//Generate and set page globals!
$twig->addGlobal('__cp', array(
'links' => $twig->render('core_links'),
'userbox' => $twig->render('core_userblock', array('name' => $_SESSION['equinox_code_username'], 'permission' => $_SESSION['equinox_code_permission'], 'mult' => @$_SESSION['equinox_code_multiple']))
));