-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathindex.php
executable file
·52 lines (42 loc) · 1.27 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
<?php
if (!file_exists('./support/dba.php')) {
header("Location: install.php");
die();
}
require('login.php');
$success = false;
require_once 'customFieldsData.php';
require_once 'support/urlBase.php';
$smarty->assign('urlBase', $urlBase);
require_once './includer.php';
if (!CheckDBCredentials($host, DB::$user, DB::$password, $dbName, $port)) {
header("Location: install.php");
die();
}
$tbls = DB::tableList();
if (count($tbls) == 0) {
header("Location: install.php");
die();
}
if ($useRegistration) {
if (!isset($user)) {
header('Location: '. $urlBase . '/inventory' . $urlPostFix);
die();
} else {
$target = SETTINGS::SettingsGetSingle("startpage",$user['username'],SETTINGS::SettingsGetSingle("startpage","defaultuser","welcome"));
header('Location: '. $urlBase . '/' . $target . $urlPostFix);
}
} else {
$target = SETTINGS::SettingsGetSingle("startpage","defaultuser","welcome");
header('Location: '. $urlBase . '/' . $target . $urlPostFix);
}
if ($usePrettyURLs) {
$smarty->assign('urlPostFix', '');
} else {
$smarty->assign('urlPostFix', '.php');
}
if (isset($_POST)) $smarty->assign('POST', $_POST);
$smarty->assign('SESSION', $_SESSION);
$smarty->assign('REQUEST', $_SERVER['REQUEST_URI']);
$smarty->display('index.tpl');
die();