-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
84 lines (58 loc) · 2.04 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/*
* Created on 14-sep-2014
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once '../include/default.inc.php';
if(User::isLoggedIn()) {
header("Cache-Control: no-cache, must-revalidate");
$arr_user = User::getUser();
$bln_user = User::isUser();
$bln_admin = User::isAdmin();
$bln_superadmin = User::isSuperAdmin();
$obj_smarty->assign('name', $arr_user['firstname'].' '.(!empty($arr_user['infix']) ? $arr_user['infix'] : '').$arr_user['lastname']);
$obj_smarty->assign('user', $_SESSION['calendar-uid']['username']);
$obj_smarty->assign('user_id', $_SESSION['calendar-uid']['uid']);
$obj_smarty->assign('is_user', $bln_user);
$obj_smarty->assign('is_admin', $bln_admin);
$obj_smarty->assign('is_super_admin', $bln_superadmin);
$language = Settings::getLanguage($arr_user['user_id']);
$obj_smarty->assign('language', $language);
if(User::isAdmin()) {
$arr_users = User::getAdminUsers(true); // users of this admin
$obj_smarty->assign('users', $arr_users);
$arr_current_event = Events::getCurrentEvent();
$obj_smarty->assign('current_events', $arr_current_event);
$arr_last_added_events = Events::getLastAddedEvents(5);
$obj_smarty->assign('last_added_events', $arr_last_added_events);
$obj_smarty->assign('active', 'admin');
$obj_smarty->display(FULLCAL_DIR.'/view/admin_panel.tpl');
} else {
header('location: '.FULLCAL_URL);
exit;
}
} else {
if(ADMIN_CAN_LOGIN_FROM_ADMIN_URL === true && ALLOW_ACCESS_BY == 'free') {
$language = Settings::getLanguage();
$obj_smarty->assign('language', $language);
$obj_smarty->display(FULLCAL_DIR.'/login.html');
} else {
header('location: '.FULLCAL_URL);
exit;
}
}
if(isset($_GET['action'])) {
switch($_GET['action']) {
case 'importUsersFromCsv':
Utils::importUsersFromCsv();
break;
default:
die('no such action available');
}
exit;
} else {
}
exit;
?>