-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
98 lines (83 loc) · 2.56 KB
/
home.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* File who includes other parts of code to build and structure the page.
*
* @author Victor ROUQUETTE
* @copyright Hammock Helicopter Database by Victor ROUQUETTE
* @license GPL
* @license https://www.gnu.org/licenses/gpl-3.0.fr.html
* @category modules
* @filesource
*/
session_start();
//Create and set var '$UserConnected' to true or false
include('account/checkConnection.php');
/*HTML Content is send if user is connected*/
if($UserConnected) {
unset($_SESSION['error']);
/* Include action file to manage forms */
if(isset($_GET['page'])) {
$currentPage = $_GET['page'];
switch ($currentPage) {
case 'changepassword':
$current_choice = 'changePWD';
break;
case 'accountsAdmin':
$current_choice = 'admin';
break;
default:
$current_choice = 'home';
break;
}
/*select the content of the home page.
Can be :
-defaulthome
-changepassword
-ataReference
-accountsAdmin
*/
$possibilities = array('changepassword');
if($lvl_access > 3) {
$possibilities = array_merge($possibilities, array('accountsAdmin'));
}
if (in_array($currentPage, $possibilities)) {
include('action/' . $currentPage . '.php');
} else {
include('action/defaulthome.php');
}
} else {
$current_choice = 'home';
include('action/defaulthome.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include("ui/head_default.php"); ?>
</head>
<body>
<!------------------------------- Navigation/Sidebar ------------------------------->
<?php include("ui/sidebar.php"); ?>
<!------------------------------- Top Menu ------------------------------->
<?php include("ui/topmenu.php"); ?>
<!------------------------------- Content ------------------------------->
<?php /* Include content file to display content */
if(isset($currentPage) AND isset($possibilities)) {
if (in_array($currentPage, $possibilities)) {
include('content/' . $currentPage . '.php');
} else {
include('content/defaulthome.php');
}
} else {
include('content/defaulthome.php');
}
?>
<!------------------------------- Footer ------------------------------->
<?php include("ui/footer.php"); ?>
</body>
</html>
<?php
} else {
header('Location: index.php');
exit();
}