Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php'; |
| 3 | |
| 4 | if (isset($_SESSION['mailcow_cc_role']) && isset($_SESSION['oauth2_request'])) { |
| 5 | $oauth2_request = $_SESSION['oauth2_request']; |
| 6 | unset($_SESSION['oauth2_request']); |
| 7 | header('Location: ' . $oauth2_request); |
| 8 | exit(); |
| 9 | } |
| 10 | elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admin') { |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame] | 11 | header('Location: /debug'); |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 12 | exit(); |
| 13 | } |
| 14 | elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'domainadmin') { |
| 15 | header('Location: /mailbox'); |
| 16 | exit(); |
| 17 | } |
| 18 | elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'user') { |
| 19 | header('Location: /user'); |
| 20 | exit(); |
| 21 | } |
| 22 | |
| 23 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php'; |
| 24 | $_SESSION['return_to'] = $_SERVER['REQUEST_URI']; |
| 25 | $_SESSION['index_query_string'] = $_SERVER['QUERY_STRING']; |
| 26 | |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 27 | $template = 'index.twig'; |
| 28 | $template_data = [ |
| 29 | 'oauth2_request' => @$_SESSION['oauth2_request'], |
| 30 | 'is_mobileconfig' => str_contains($_SESSION['index_query_string'], 'mobileconfig'), |
| 31 | 'login_delay' => @$_SESSION['ldelay'], |
| 32 | ]; |
| 33 | |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 34 | $js_minifier->add('/web/js/site/index.js'); |
| 35 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php'; |