-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashboard.php
51 lines (46 loc) · 1.47 KB
/
dashboard.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
<?php
/**
* Created by PhpStorm.
* User: Janik Rapp
* Date: 15.04.2016
* Time: 18:10
*/
require_once 'classes/PDO_MYSQL.php'; //DB Anbindung
require_once 'libs/dwoo/lib/Dwoo/Autoloader.php'; //Dwoo Laden
require_once 'classes/User.php';
require_once 'classes/Permissions.php';
require_once 'classes/Util.php';
require_once 'classes/Citizen.php';
require_once 'classes/Error.php';
require_once 'classes/TracingEntry.php';
require_once 'classes/LogEntry.php';
$user = \Entrance\Util::checkSession();
$pdo = new \Entrance\PDO_MYSQL();
Dwoo\Autoloader::register();
$dwoo = new Dwoo\Core();
$action = $_GET["action"];
if($action == "closeState") {
if ($user->isActionAllowed(PERM_ADMIN_STATE_CLOSE)) {
\Entrance\Util::closeState();
echo json_encode(["success" => true]);
exit; //To not show the list
} else {
echo json_encode(["success" => false]);
exit;
}
} elseif($action == "openState") {
if ($user->isActionAllowed(PERM_ADMIN_STATE_OPEN)) {
\Entrance\Util::openState();
echo json_encode(["success" => true]);
exit; //To not show the list
} else {
echo json_encode(["success" => false]);
exit;
}
}
if($user->isActionAllowed(PERM_ADMIN_STATE_DASHBOARD)) {
$dwoo->output("tpl/dashboard.tpl", \Entrance\Util::getEditorPageDataStub("Dashboard", $user));
} else {
$pgdata = \Entrance\Util::getEditorPageDataStub("Dashboard", $user);
$dwoo->output("tpl/noPrivileges.tpl", $pgdata);
}