forked from DOMjudge/domjudge
/
index.php
30 lines (24 loc) · 880 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
<?php
/**
* Switch a user to the right site based on whether they can be
* authenticated as team, jury, or nothing (public).
*
* Part of the DOMjudge Programming Contest Jury System and licenced
* under the GNU GPL. See README and COPYING for details.
*/
require_once('configure.php');
require_once(LIBDIR . '/lib.error.php');
require_once(LIBDIR . '/lib.misc.php');
require_once(LIBDIR . '/use_db.php');
// Team login necessary for checking login credentials:
setup_database_connection();
require_once(LIBWWWDIR . '/common.php');
require_once(LIBWWWDIR . '/auth.php');
$target = 'public/';
if ( logged_in() ) {
if ( checkrole('jury') ) $target = 'jury/';
elseif ( checkrole('team',false) ) $target = 'team/';
elseif ( checkrole('balloon') ) $target = 'jury/balloons.php';
}
header('HTTP/1.1 302 Please see this page');
header('Location: ' . $target);