mailcow-dockerized/data/web/index.php

36 lines
1.2 KiB
PHP
Raw Normal View History

2017-03-02 18:23:23 +08:00
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
2017-03-02 18:23:23 +08: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') {
header('Location: /admin');
exit();
2017-03-02 18:23:23 +08:00
}
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'domainadmin') {
header('Location: /mailbox');
exit();
2017-03-02 18:23:23 +08:00
}
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'user') {
header('Location: /user');
exit();
2017-03-02 18:23:23 +08:00
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
2017-03-02 18:23:23 +08:00
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
2019-12-15 20:02:38 +08:00
$_SESSION['index_query_string'] = $_SERVER['QUERY_STRING'];
2017-12-09 20:17:15 +08:00
$template = 'index.twig';
$template_data = [
'oauth2_request' => @$_SESSION['oauth2_request'],
'is_mobileconfig' => str_contains($_SESSION['index_query_string'], 'mobileconfig'),
'login_delay' => @$_SESSION['ldelay'],
];
$js_minifier->add('/web/js/site/index.js');
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';