public
nobgit
read
NobMail
Based on mailcow: dockerized
Languages
Repository composition by tracked source files.
PHP
49%
JavaScript
35%
HTML
9%
CSS
4%
Shell
2%
Python
1%
Lua
0%
Perl
0%
Ruby
0%
SCSS
0%
Create file
Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git
Trace
data/web/index.php
Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.
Author
Date
Commit
Line
Code
1
<?php
2
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
3
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/triggers.user.inc.php';
5
if (isset($_SESSION['mailcow_cc_role']) && isset($_SESSION['oauth2_request'])) {
6
$oauth2_request = $_SESSION['oauth2_request'];
7
unset($_SESSION['oauth2_request']);
8
header('Location: ' . $oauth2_request);
9
exit();
10
}
11
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'user') {
12
if (empty($_SESSION['pending_tfa_setup']) && empty($_SESSION['pending_pw_update'])) {
13
$user_details = mailbox("get", "mailbox_details", $_SESSION['mailcow_cc_username']);
14
$is_dual = (!empty($_SESSION["dual-login"]["username"])) ? true : false;
15
if (intval($user_details['attributes']['sogo_access']) == 1 && !$is_dual && getenv('SKIP_SOGO') != "y") {
16
header("Location: /SOGo/so/");
17
} else {
18
header("Location: /user");
19
}
20
exit();
21
}
22
}
23
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admin') {
24
if (empty($_SESSION['pending_tfa_setup']) && empty($_SESSION['pending_pw_update'])) {
25
header('Location: /admin/dashboard');
26
exit();
27
}
28
}
29
elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'domainadmin') {
30
if (empty($_SESSION['pending_tfa_setup']) && empty($_SESSION['pending_pw_update'])) {
31
header('Location: /domainadmin/mailbox');
32
exit();
33
}
34
}
36
$host = strtolower($_SERVER['HTTP_HOST'] ?? '');
37
if (str_starts_with($host, 'autodiscover.') || str_starts_with($host, 'autoconfig.')) {
38
http_response_code(404);
39
exit();
40
}
42
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
43
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
44
$_SESSION['index_query_string'] = $_SERVER['QUERY_STRING'];
46
$has_iam_sso = false;
47
if ($iam_provider){
48
$iam_redirect_url = identity_provider("get-redirect");
49
$has_iam_sso = $iam_redirect_url ? true : false;
50
}
51
$custom_login = customize('get', 'custom_login');
53
$template = 'user_index.twig';
54
$template_data = [
55
'oauth2_request' => @$_SESSION['oauth2_request'],
56
'is_mobileconfig' => str_contains($_SESSION['index_query_string'], 'mobileconfig'),
57
'login_delay' => @$_SESSION['ldelay'],
58
'has_iam_sso' => $has_iam_sso,
59
'custom_login' => $custom_login,
60
];
62
$js_minifier->add('/web/js/site/index.js');
63
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';