-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
85 lines (62 loc) · 2.61 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
85
<?php
/*
This file is part of VCMS.
VCMS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VCMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with VCMS. If not, see <http://www.gnu.org/licenses/>.
*/
if(is_file('installer.php')){
die('Um das VCMS zu nutzen, muss nach der Installation die Datei installer.php entfernt werden.');
}
require_once('custom/systemconfig.php');
require_once('vendor/vcms/initialize.php');
$libDb->connect();
$libCronjobs->executeDueJobs();
if(isset($_POST['intranet_login_email']) && isset($_POST['intranet_login_password'])){
$libAuth = new \vcms\LibAuth();
$isLoggedIn = $libAuth->login($_POST['intranet_login_email'], $_POST['intranet_login_password']);
if($isLoggedIn){
session_start();
$_SESSION['libAuth'] = $libAuth;
}
}
$libMenuInternet = $libModuleHandler->getMenuInternet();
$libMenuIntranet = $libModuleHandler->getMenuIntranet();
$libMenuAdministration = $libModuleHandler->getMenuAdministration();
if(!isset($_GET['pid']) || $_GET['pid'] == ''){
$defaultHomeExists = $libModuleHandler->pageExists($libConfig->defaultHome);
if($defaultHomeExists){
$libGlobal->pid = $libConfig->defaultHome;
} else {
$libGlobal->pid = 'login';
}
} else {
$libGlobal->pid = $_GET['pid'];
}
if(!$libModuleHandler->pageExists($libGlobal->pid)){
http_response_code(404);
die('HTTP-Fehler 404: Seite nicht gefunden.');
} elseif(!$libSecurityManager->hasAccess($libModuleHandler->getPage($libGlobal->pid), $libAuth)){
http_response_code(403);
}
$libGlobal->page = $libModuleHandler->getPage($libGlobal->pid);
$libGlobal->module = $libModuleHandler->getModuleByPageid($libGlobal->pid);
require_once('vendor/vcms/layout/header.php');
if(is_object($libGlobal->page) && $libSecurityManager->hasAccess($libGlobal->page, $libAuth)){
if(is_file($libGlobal->page->getPath())){
require_once($libGlobal->page->getPath());
}
} else {
echo '<h1>Zugriffsfehler</h1>';
echo $libString->getErrorBoxText();
echo $libString->getNotificationBoxText();
echo '<p class="mb-4">Für diese Seite ist eine <a href="index.php?pid=login">Anmeldung im Intranet</a> nötig.</p>';
}
require_once('vendor/vcms/layout/footer.php');