2017-03-02 12:23:23 +02:00
|
|
|
<?php
|
2018-10-11 11:59:23 +02:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
2017-03-02 12:23:23 +02:00
|
|
|
|
2019-10-02 19:00:36 +02:00
|
|
|
if (isset($_SESSION['mailcow_cc_role']) && isset($_SESSION['oauth2_request'])) {
|
|
|
|
$oauth2_request = $_SESSION['oauth2_request'];
|
|
|
|
unset($_SESSION['oauth2_request']);
|
|
|
|
header('Location: ' . $oauth2_request);
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admin') {
|
2022-08-08 13:24:29 +02:00
|
|
|
header('Location: /debug');
|
2017-05-16 19:20:58 +02:00
|
|
|
exit();
|
2017-03-02 12:23:23 +02:00
|
|
|
}
|
2017-05-16 19:20:58 +02:00
|
|
|
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'domainadmin') {
|
2018-10-04 14:38:12 +02:00
|
|
|
header('Location: /mailbox');
|
2017-05-16 19:20:58 +02:00
|
|
|
exit();
|
2017-03-02 12:23:23 +02:00
|
|
|
}
|
2017-05-16 19:20:58 +02:00
|
|
|
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'user') {
|
2018-10-04 14:38:12 +02:00
|
|
|
header('Location: /user');
|
2017-05-16 19:20:58 +02:00
|
|
|
exit();
|
2017-03-02 12:23:23 +02:00
|
|
|
}
|
2018-10-11 11:59:23 +02:00
|
|
|
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
|
2017-03-02 12:23:23 +02:00
|
|
|
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
2019-12-15 14:02:38 +02:00
|
|
|
$_SESSION['index_query_string'] = $_SERVER['QUERY_STRING'];
|
2017-12-09 14:17:15 +02:00
|
|
|
|
2021-09-22 20:47:10 +02:00
|
|
|
$template = 'index.twig';
|
|
|
|
$template_data = [
|
|
|
|
'oauth2_request' => @$_SESSION['oauth2_request'],
|
|
|
|
'is_mobileconfig' => str_contains($_SESSION['index_query_string'], 'mobileconfig'),
|
|
|
|
'login_delay' => @$_SESSION['ldelay'],
|
2023-03-14 15:30:32 +02:00
|
|
|
'has_keycloak_sso' => ($keycloak_provider) ? true : false,
|
|
|
|
'invalid_keycloak_sso' => $_SESSION['invalid_keycloak_sso']
|
2021-09-22 20:47:10 +02:00
|
|
|
];
|
|
|
|
|
2019-01-31 16:45:31 +02:00
|
|
|
$js_minifier->add('/web/js/site/index.js');
|
2018-10-11 11:59:23 +02:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|