-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmessages.php
50 lines (45 loc) · 1.47 KB
/
messages.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
<?php
if (file_exists('config.php')) {
include_once('config.php');
}
else {
$_SESSION['errors']['general'] = $lang['error']['config'];
}
// If the system is installed, let's proceed
if (defined('INSTALLED')) {
include_once('includes/includes.php');
include_once('includes/functions.php');
// We need to check if we are logged in already or not
if (empty($_SESSION['logged'])) {
// We aren't logged in, so we need to redirect to login.
$_SESSION['destination'] = $_SERVER['REQUEST_URI'];
header("Location: login.php");
}
else {
// We are already logged in, so let's proceed
// Let's find out if we are reading a message, or if we are at the main message page
if (!empty($_GET['a']) && ($_GET['a'] == 'compose')) {
include_once('includes/messages_compose.php');
}
else {
if (!empty($_GET['cid'])) {
$cid = $_GET['cid'];
include_once('includes/messages_read.php');
}
else {
include_once('includes/messages.php');
}
}
}
}
else {
// If the config file exists, but the system is not installed, throw an error and redirect to the install directory
$_SESSION['errors']['install'] = $lang['error']['install']['not_installed'];
header("Location: install/index.php");
}
include_once('themes/'.$theme.'/views/header.php');
include_once('themes/'.$theme.'/views/nav.php');
include_once('themes/'.$theme.'/views/messages.php');
include_once('themes/'.$theme.'/views/footer.php');
echo $output;
?>