forked from WebPA/WebPA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
41 lines (36 loc) · 948 Bytes
/
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
<?php
/**
*
* INDEX - Main page
*
* @copyright 2007 Loughborough University
* @license http://www.gnu.org/licenses/gpl.txt
* @version 1.0.0.0
*
*/
require_once('includes/inc_global.php');
$mod = '';
if (isset($_SERVER['PATH_INFO']) && (strlen($_SERVER['PATH_INFO']) > 0)) {
$mod = substr($_SERVER['PATH_INFO'], 1);
} else if (isset($_SERVER['QUERY_STRING'])) {
$mod = $_SERVER['QUERY_STRING'];
}
if ($mod && in_array($mod, $INSTALLED_MODS)) {
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
include_once("mod/{$mod}/index.php");
} else {
header('Location: ' . APP__WWW . "/mod/{$mod}/");
}
} else if ($_user) {
if ($_user->is_admin()) {
header('Location: ' . APP__WWW . '/admin/');
} else if ($_user->is_tutor()) {
header('Location: ' . APP__WWW . '/tutors/');
} else {
header('Location: ' . APP__WWW . '/students/');
}
} else {
header('Location: ' . APP__WWW . '/login.php');
}
exit;
?>