2018-08-03 20:31:33 +02:00
|
|
|
<!DOCTYPE html>
|
2017-05-16 19:20:58 +02:00
|
|
|
<html lang="<?= $_SESSION['mailcow_locale'] ?>">
|
|
|
|
<head>
|
2018-10-04 14:38:12 +02:00
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
2019-07-22 21:11:25 +02:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
2018-10-04 14:38:12 +02:00
|
|
|
<meta name="theme-color" content="#F5D76E"/>
|
|
|
|
<meta http-equiv="Referrer-Policy" content="same-origin">
|
|
|
|
<title><?=$UI_TEXTS['title_name'];?></title>
|
2019-02-06 10:14:56 +01:00
|
|
|
<?php
|
2019-01-31 15:45:31 +01:00
|
|
|
if (preg_match("/mailbox/i", $_SERVER['REQUEST_URI'])) {
|
|
|
|
$css_minifier->add('/web/css/site/mailbox.css');
|
|
|
|
}
|
|
|
|
if (preg_match("/admin/i", $_SERVER['REQUEST_URI'])) {
|
|
|
|
$css_minifier->add('/web/css/site/admin.css');
|
|
|
|
}
|
|
|
|
if (preg_match("/user/i", $_SERVER['REQUEST_URI'])) {
|
|
|
|
$css_minifier->add('/web/css/site/user.css');
|
|
|
|
}
|
|
|
|
if (preg_match("/edit/i", $_SERVER['REQUEST_URI'])) {
|
|
|
|
$css_minifier->add('/web/css/site/edit.css');
|
|
|
|
}
|
2020-06-06 13:25:32 +02:00
|
|
|
if (preg_match("/(quarantine|qhandler)/i", $_SERVER['REQUEST_URI'])) {
|
2019-01-31 15:45:31 +01:00
|
|
|
$css_minifier->add('/web/css/site/quarantine.css');
|
|
|
|
}
|
|
|
|
if (preg_match("/debug/i", $_SERVER['REQUEST_URI'])) {
|
|
|
|
$css_minifier->add('/web/css/site/debug.css');
|
|
|
|
}
|
2019-07-23 21:33:24 +02:00
|
|
|
if ($_SERVER['REQUEST_URI'] == '/') {
|
|
|
|
$css_minifier->add('/web/css/site/index.css');
|
|
|
|
}
|
2019-10-20 21:25:58 +02:00
|
|
|
|
|
|
|
$hash = $css_minifier->getDataHash();
|
|
|
|
$CSSPath = '/tmp/' . $hash . '.css';
|
|
|
|
if(!file_exists($CSSPath)) {
|
|
|
|
$css_minifier->minify($CSSPath);
|
|
|
|
cleanupCSS($hash);
|
|
|
|
}
|
2019-01-31 15:45:31 +01:00
|
|
|
?>
|
2019-10-20 21:25:58 +02:00
|
|
|
<link rel="stylesheet" href="/cache/<?=basename($CSSPath)?>">
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php if (strtolower(trim($DEFAULT_THEME)) != "lumen") { ?>
|
2019-02-06 10:14:56 +01:00
|
|
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/<?= strtolower(trim($DEFAULT_THEME)); ?>/bootstrap.min.css">
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } ?>
|
2018-10-04 14:38:12 +02:00
|
|
|
<link rel="shortcut icon" href="/favicon.png" type="image/png">
|
|
|
|
<link rel="icon" href="/favicon.png" type="image/png">
|
2017-05-16 19:20:58 +02:00
|
|
|
</head>
|
2018-01-25 13:22:17 +01:00
|
|
|
<body id="top">
|
2018-10-04 14:38:12 +02:00
|
|
|
<div class="overlay"></div>
|
|
|
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="navbar-header">
|
|
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
<span class="icon-bar"></span>
|
|
|
|
</button>
|
|
|
|
<a class="navbar-brand" href="/"><img alt="mailcow-logo" src="<?=($main_logo = customize('get', 'main_logo')) ? $main_logo : '/img/cow_mailcow.svg';?>"></a>
|
|
|
|
</div>
|
|
|
|
<div id="navbar" class="navbar-collapse collapse">
|
|
|
|
<ul class="nav navbar-nav navbar-right">
|
|
|
|
<?php
|
|
|
|
if (isset($_SESSION['mailcow_locale'])) {
|
|
|
|
?>
|
|
|
|
<li class="dropdown<?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? ' lang-link-disabled"' : '' ?>">
|
2021-06-08 13:16:10 +02:00
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="flag-icon flag-icon-<?= $_SESSION['mailcow_locale']; ?>"></span><span class="caret"></span></a>
|
2018-10-04 14:38:12 +02:00
|
|
|
<ul class="dropdown-menu" role="menu">
|
2017-05-16 19:20:58 +02:00
|
|
|
<?php
|
2021-06-08 13:16:10 +02:00
|
|
|
foreach ($AVAILABLE_LANGUAGES as $c => $v) {
|
2017-05-16 19:20:58 +02:00
|
|
|
?>
|
2021-06-08 13:16:10 +02:00
|
|
|
<li<?= ($_SESSION['mailcow_locale'] == $c) ? ' class="active"' : ''; ?>><a href="?<?= http_build_query(array_merge($_GET, array('lang' => $c))); ?>"><span class="flag-icon flag-icon-<?=$c;?>"></span> <?=$v;?></a></li>
|
2017-05-16 19:20:58 +02:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2018-10-04 14:38:12 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if (isset($_SESSION['mailcow_cc_role'])) {
|
|
|
|
?>
|
|
|
|
<li class="dropdown">
|
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?= $lang['header']['mailcow_settings']; ?> <span class="caret"></span></a>
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
2017-05-16 19:20:58 +02:00
|
|
|
<?php
|
2018-10-04 14:38:12 +02:00
|
|
|
if (isset($_SESSION['mailcow_cc_role'])) {
|
|
|
|
if ($_SESSION['mailcow_cc_role'] == 'admin') {
|
|
|
|
?>
|
|
|
|
<li<?= (preg_match("/admin/i", $_SERVER['REQUEST_URI'])) ? ' class="active"' : ''; ?>><a href="/admin"><?= $lang['header']['administration']; ?></a></li>
|
|
|
|
<li<?= (preg_match("/debug/i", $_SERVER['REQUEST_URI'])) ? ' class="active"' : ''; ?>><a href="/debug"><?= $lang['header']['debug']; ?></a></li>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
if ($_SESSION['mailcow_cc_role'] == 'admin' || $_SESSION['mailcow_cc_role'] == 'domainadmin') {
|
|
|
|
?>
|
|
|
|
<li<?= (preg_match("/mailbox/i", $_SERVER['REQUEST_URI'])) ? ' class="active"' : ''; ?>><a href="/mailbox"><?= $lang['header']['mailboxes']; ?></a></li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } if ($_SESSION['mailcow_cc_role'] != 'admin') { ?>
|
2018-10-04 14:38:12 +02:00
|
|
|
<li<?= (preg_match("/user/i", $_SERVER['REQUEST_URI'])) ? ' class="active"' : ''; ?>><a href="/user"><?= $lang['header']['user_settings']; ?></a></li>
|
|
|
|
<?php
|
|
|
|
}
|
2017-05-16 19:20:58 +02:00
|
|
|
}
|
2018-10-04 14:38:12 +02:00
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php if (isset($_SESSION['mailcow_cc_role'])) { ?>
|
2021-05-22 12:13:37 +02:00
|
|
|
<li<?= (preg_match("/quarantine/i", $_SERVER['REQUEST_URI'])) ? ' class="active"' : ''; ?>><a href="/quarantine"><i class="bi bi-inbox-fill"></i> <?= $lang['header']['quarantine']; ?></a></li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } if ($_SESSION['mailcow_cc_role'] == 'admin' && getenv('SKIP_SOGO') != "y") { ?>
|
2021-05-22 12:13:37 +02:00
|
|
|
<li><a href data-toggle="modal" data-container="sogo-mailcow" data-target="#RestartContainer"><i class="bi bi-arrow-repeat"></i> <?= $lang['header']['restart_sogo']; ?></a></li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } ?>
|
2018-10-04 14:38:12 +02:00
|
|
|
<li class="dropdown">
|
2021-08-01 18:00:14 +02:00
|
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="bi bi-link-45deg"></i> <?=$UI_TEXTS['apps_name'];?> <span class="caret"></span></a>
|
2018-10-04 14:38:12 +02:00
|
|
|
<ul class="dropdown-menu" role="menu">
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php foreach ($MAILCOW_APPS as $app) {
|
|
|
|
if (getenv('SKIP_SOGO') == "y" && preg_match('/^\/SOGo/i', $app['link'])) { continue; }
|
2018-10-04 14:38:12 +02:00
|
|
|
?>
|
|
|
|
<li title="<?= htmlspecialchars($app['description']); ?>"><a href="<?= htmlspecialchars($app['link']); ?>"><?= htmlspecialchars($app['name']); ?></a></li>
|
|
|
|
<?php
|
2020-04-29 10:57:49 +02:00
|
|
|
}
|
2018-10-04 14:38:12 +02:00
|
|
|
$app_links = customize('get', 'app_links');
|
2019-02-05 00:10:21 +01:00
|
|
|
if ($app_links) {
|
|
|
|
foreach ($app_links as $row) {
|
2020-04-29 10:57:49 +02:00
|
|
|
foreach ($row as $key => $val) {
|
2019-02-05 00:10:21 +01:00
|
|
|
?>
|
2018-10-04 14:38:12 +02:00
|
|
|
<li><a href="<?= htmlspecialchars($val); ?>"><?= htmlspecialchars($key); ?></a></li>
|
2019-02-05 00:10:21 +01:00
|
|
|
<?php
|
2020-04-29 10:57:49 +02:00
|
|
|
}
|
2019-02-05 00:10:21 +01:00
|
|
|
}
|
2018-10-04 14:38:12 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } if (!isset($_SESSION['dual-login']) && isset($_SESSION['mailcow_cc_username'])) { ?>
|
2021-05-23 13:18:52 +02:00
|
|
|
<li class="logged-in-as"><a href="#" onclick="logout.submit()"><b class="username-lia"><?= htmlspecialchars($_SESSION['mailcow_cc_username']); ?></b> <i class="bi bi-power"></i></a></li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } elseif (isset($_SESSION['dual-login'])) { ?>
|
2021-05-23 13:18:52 +02:00
|
|
|
<li class="logged-in-as"><a href="#" onclick="logout.submit()"><b class="username-lia"><?= htmlspecialchars($_SESSION['mailcow_cc_username']); ?> <span class="text-info">(<?= htmlspecialchars($_SESSION['dual-login']['username']); ?>)</span> </b><i class="bi bi-power"></i></a></li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } if (!preg_match('/y|yes/i', getenv('MASTER'))) { ?>
|
2020-03-28 19:51:42 +01:00
|
|
|
<li class="text-warning slave-info">[ slave ]</li>
|
2020-04-29 10:57:49 +02:00
|
|
|
<?php } ?>
|
2018-10-04 14:38:12 +02:00
|
|
|
</ul>
|
|
|
|
</div><!--/.nav-collapse -->
|
|
|
|
</div><!--/.container-fluid -->
|
|
|
|
</nav>
|
|
|
|
<form action="/" method="post" id="logout"><input type="hidden" name="logout"></form>
|
2020-05-11 11:52:02 +02:00
|
|
|
<?php if (!empty($UI_TEXTS['ui_announcement_text']) &&
|
|
|
|
in_array($UI_TEXTS['ui_announcement_type'], array('info', 'warning', 'danger')) &&
|
|
|
|
$UI_TEXTS['ui_announcement_active'] == 1 &&
|
|
|
|
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) != '/') { ?>
|
|
|
|
<div class="container">
|
|
|
|
<div class="alert alert-<?=$UI_TEXTS['ui_announcement_type'];?>"><?=$UI_TEXTS['ui_announcement_text'];?></div>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|