-
-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathindex.php
More file actions
37 lines (30 loc) · 888 Bytes
/
index.php
File metadata and controls
37 lines (30 loc) · 888 Bytes
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
<?php
// Check if the app is set up
if (file_exists("config.php")) {
require_once "config.php";
// Check if setup is enabled (not completed)
if (!isset($config_enable_setup) || $config_enable_setup == 1) {
header("Location: /setup");
exit();
}
// Start the session
require_once "includes/session_init.php";
// If user is an agent
if (isset($_SESSION['logged'])) {
require_once "includes/load_global_settings.php";
header("Location: /agent/$config_start_page");
exit();
// If user is a client
} elseif (isset($_SESSION['client_logged_in'])) {
header("Location: /client/");
exit();
// Not logged in
} else {
header("Location: /login.php");
exit();
}
} else {
// If config.php doesn't exist, redirect to setup
header("Location: /setup");
exit();
}