2016-12-10 03:39:02 +08:00
|
|
|
<?php
|
2018-10-11 17:59:23 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
2019-01-29 07:20:39 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
if (!isset($_SESSION['mailcow_cc_role']) || $_SESSION['mailcow_cc_role'] != "admin" && $_SESSION['mailcow_cc_role'] != "domainadmin") {
|
|
|
|
header('Location: /');
|
|
|
|
exit();
|
|
|
|
}
|
2018-10-11 17:59:23 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
|
2016-12-10 03:39:02 +08:00
|
|
|
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
2020-11-06 21:26:48 +08:00
|
|
|
|
2017-03-28 17:51:17 +08:00
|
|
|
|
2017-01-28 16:53:39 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
$js_minifier->add('/web/js/site/mailbox.js');
|
|
|
|
$js_minifier->add('/web/js/presets/sieveMailbox.js');
|
|
|
|
$js_minifier->add('/web/js/site/pwgen.js');
|
2017-04-27 14:44:21 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
$role = ($_SESSION['mailcow_cc_role'] == "admin") ? 'admin' : 'domainadmin';
|
|
|
|
$is_dual = (!empty($_SESSION["dual-login"]["username"])) ? 'true' : 'false';
|
|
|
|
$allow_admin_email_login = (preg_match("/^([yY][eE][sS]|[yY])+$/", $_ENV["ALLOW_ADMIN_EMAIL_LOGIN"])) ? 'true' : 'false';
|
2017-07-29 16:32:17 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
// domains
|
|
|
|
$domains = mailbox('get', 'domains');
|
2017-11-04 03:37:24 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
// mailboxes
|
|
|
|
$mailboxes = [];
|
|
|
|
foreach ($domains as $domain) {
|
|
|
|
foreach (mailbox('get', 'mailboxes', $domain) as $mailbox) {
|
|
|
|
$mailboxes[] = $mailbox;
|
|
|
|
}
|
|
|
|
}
|
2017-11-02 02:22:13 +08:00
|
|
|
|
2021-09-23 02:47:10 +08:00
|
|
|
$template = 'mailbox.twig';
|
|
|
|
$template_data = [
|
|
|
|
'acl' => $_SESSION['acl'],
|
|
|
|
'acl_json' => json_encode($_SESSION['acl']),
|
|
|
|
'role' => $role,
|
|
|
|
'is_dual' => $is_dual,
|
|
|
|
'allow_admin_email_login' => $allow_admin_email_login,
|
|
|
|
'global_filters' => mailbox('get', 'global_filter_details'),
|
|
|
|
'domains' => $domains,
|
|
|
|
'mailboxes' => $mailboxes,
|
|
|
|
'lang_mailbox' => json_encode($lang['mailbox']),
|
2022-11-10 23:22:18 +08:00
|
|
|
'lang_rl' => json_encode($lang['ratelimit']),
|
2022-05-16 17:26:49 +08:00
|
|
|
'lang_datatables' => json_encode($lang['datatables']),
|
2021-09-23 02:47:10 +08:00
|
|
|
];
|
2018-10-04 20:38:12 +08:00
|
|
|
|
2017-11-02 02:27:30 +08:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|