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') {
|
2018-10-04 14:38:12 +02:00
|
|
|
header('Location: /admin');
|
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
|
|
|
|
2017-03-02 12:23:23 +02:00
|
|
|
?>
|
|
|
|
<div class="container">
|
2017-05-16 19:20:58 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-offset-3 col-md-6">
|
|
|
|
<div class="panel panel-default">
|
2021-05-22 12:13:37 +02:00
|
|
|
<div class="panel-heading"><i class="bi bi-person-bounding-box"></i> <?= $lang['login']['login']; ?></div>
|
2017-05-16 19:20:58 +02:00
|
|
|
<div class="panel-body">
|
2017-10-21 10:07:06 +02:00
|
|
|
<div class="text-center mailcow-logo"><img src="<?=($main_logo = customize('get', 'main_logo')) ? $main_logo : '/img/cow_mailcow.svg';?>" alt="mailcow"></div>
|
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) { ?>
|
2021-05-30 16:07:57 +02:00
|
|
|
<div class="alert alert-<?=$UI_TEXTS['ui_announcement_type'];?> rot-enc ui-announcement-alert"><?=str_rot13($UI_TEXTS['ui_announcement_text']);?></div>
|
2020-05-11 11:52:02 +02:00
|
|
|
<?php } ?>
|
2019-10-22 20:23:00 +02:00
|
|
|
<legend><?= isset($_SESSION['oauth2_request']) ? $lang['oauth2']['authorize_app'] : $UI_TEXTS['main_name'];?></legend>
|
2019-12-15 14:02:38 +02:00
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
if (strpos($_SESSION['index_query_string'], 'mobileconfig') !== false) {
|
2019-12-15 14:02:38 +02:00
|
|
|
?>
|
|
|
|
<div class="alert alert-info"><?= $lang['login']['mobileconfig_info']; ?></div>
|
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
}
|
2019-12-15 14:02:38 +02:00
|
|
|
?>
|
2017-05-16 19:20:58 +02:00
|
|
|
<form method="post" autofill="off">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="sr-only" for="login_user"><?= $lang['login']['username']; ?></label>
|
|
|
|
<div class="input-group">
|
2021-05-22 12:13:37 +02:00
|
|
|
<div class="input-group-addon"><i class="bi bi-person-fill"></i></div>
|
2019-12-15 14:02:38 +02:00
|
|
|
<input name="login_user" autocorrect="off" autocapitalize="none" type="<?=(strpos($_SESSION['index_query_string'], 'mobileconfig') !== false) ? 'email' : 'text';?>" id="login_user" class="form-control" placeholder="<?= $lang['login']['username']; ?>" required="" autofocus="">
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="sr-only" for="pass_user"><?= $lang['login']['password']; ?></label>
|
|
|
|
<div class="input-group">
|
2021-05-22 12:13:37 +02:00
|
|
|
<div class="input-group-addon"><i class="bi bi-lock-fill"></i></div>
|
2017-05-16 19:20:58 +02:00
|
|
|
<input name="pass_user" type="password" id="pass_user" class="form-control" placeholder="<?= $lang['login']['password']; ?>" required="">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2020-11-15 20:32:37 +02:00
|
|
|
<div class="btn-group">
|
|
|
|
<button type="submit" class="btn btn-success" value="Login"><?= $lang['login']['login']; ?></button>
|
|
|
|
<div class="btn-group">
|
|
|
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
|
|
|
<?= $lang['login']['other_logins']; ?> <span class="caret"></span></button>
|
|
|
|
<ul class="dropdown-menu" role="menu">
|
|
|
|
<li><a href="#" id="fido2-login"><?= $lang['login']['fido2_webauthn']; ?></a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php if(!isset($_SESSION['oauth2_request'])) { ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
<div class="btn-group pull-right">
|
2018-01-15 16:44:04 +02:00
|
|
|
<button type="button" <?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? 'disabled="true"' : '' ?> class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
2017-05-16 19:20:58 +02:00
|
|
|
<span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span> <span class="caret"></span>
|
|
|
|
</button>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
foreach ($AVAILABLE_LANGUAGES as $language) {
|
2017-05-16 19:20:58 +02:00
|
|
|
?>
|
2017-05-16 19:25:35 +02:00
|
|
|
<li<?= ($_SESSION['mailcow_locale'] == $language) ? ' class="active"' : ''; ?>><a href="?<?= http_build_query(array_merge($_GET, array('lang' => $language))) ?>"><span class="lang-xs lang-lbl-full" lang="<?= $language; ?>"></span></a></li>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
</ul>
|
|
|
|
</div>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
if (isset($_SESSION['ldelay']) && $_SESSION['ldelay'] != '0') {
|
2017-05-16 19:20:58 +02:00
|
|
|
?>
|
|
|
|
<p><div class="alert alert-info"><?= sprintf($lang['login']['delayed'], $_SESSION['ldelay']); ?></b></div></p>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } ?>
|
2020-11-15 20:32:37 +02:00
|
|
|
<div id="fido2-alerts"></div>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php if(!isset($_SESSION['oauth2_request'])) { ?>
|
2021-05-22 12:13:37 +02:00
|
|
|
<legend><i class="bi bi-link-45deg"></i> <?=$UI_TEXTS['apps_name'];?></legend>
|
2017-05-16 19:20:58 +02:00
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
if (!empty($MAILCOW_APPS)) {
|
|
|
|
foreach ($MAILCOW_APPS as $app) {
|
|
|
|
if (getenv('SKIP_SOGO') == "y" && preg_match('/^\/SOGo/i', $app['link'])) { continue; }
|
|
|
|
?>
|
|
|
|
<a href="<?= htmlspecialchars($app['link']); ?>" role="button" style="margin-bottom:3pt" title="<?= htmlspecialchars($app['description']); ?>" class="btn btn-primary"><?= htmlspecialchars($app['name']); ?></a>
|
|
|
|
<?php
|
|
|
|
}
|
2020-08-15 10:14:33 +02:00
|
|
|
}
|
|
|
|
$app_links = customize('get', 'app_links');
|
|
|
|
if (!empty($app_links)) {
|
|
|
|
foreach ($app_links as $row) {
|
|
|
|
foreach ($row as $key => $val) {
|
|
|
|
?>
|
|
|
|
<a href="<?= htmlspecialchars($val); ?>" role="button" style="margin-bottom:3pt" class="btn btn-primary"><?= htmlspecialchars($key); ?></a>
|
|
|
|
<?php
|
2020-04-27 17:27:47 +02:00
|
|
|
}
|
|
|
|
}
|
2017-11-21 10:33:22 +02:00
|
|
|
}
|
2017-10-21 10:07:06 +02:00
|
|
|
}
|
2017-03-21 13:22:13 +02:00
|
|
|
?>
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php if(!isset($_SESSION['oauth2_request'])) { ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
<div class="col-md-offset-3 col-md-6">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2021-05-22 12:13:37 +02:00
|
|
|
<a data-toggle="collapse" href="#collapse1"><i class="bi bi-patch-question-fill"></i> <?= $lang['start']['help']; ?></a>
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
<div id="collapse1" class="panel-collapse collapse">
|
|
|
|
<div class="panel-body">
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php if ($UI_TEXTS['help_text']) { ?>
|
2017-12-09 14:17:15 +02:00
|
|
|
<p><?=$UI_TEXTS['help_text'];?></p>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } else { ?>
|
2017-12-09 14:17:15 +02:00
|
|
|
<p><span style="border-bottom: 1px dotted #999;"><?=$UI_TEXTS['main_name'];?></span></p>
|
2017-05-16 19:20:58 +02:00
|
|
|
<p><?= $lang['start']['mailcow_panel_detail']; ?></p>
|
2017-12-09 14:17:15 +02:00
|
|
|
<p><span style="border-bottom: 1px dotted #999;"><?=$UI_TEXTS['apps_name'];?></span></p>
|
2017-05-16 19:20:58 +02:00
|
|
|
<p><?= $lang['start']['mailcow_apps_detail']; ?></p>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-27 17:27:47 +02:00
|
|
|
<?php } ?>
|
2017-05-16 19:20:58 +02:00
|
|
|
</div>
|
|
|
|
</div><!-- /.container -->
|
2017-03-02 12:23:23 +02:00
|
|
|
<?php
|
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';
|