2017-03-02 11:23:23 +01:00
|
|
|
<?php
|
|
|
|
require_once("inc/prerequisites.inc.php");
|
|
|
|
|
|
|
|
if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") {
|
|
|
|
require_once("inc/header.inc.php");
|
|
|
|
$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
|
|
|
$tfa_data = get_tfa();
|
|
|
|
?>
|
|
|
|
<div class="container">
|
2017-05-08 00:27:35 +02:00
|
|
|
<ul class="nav nav-tabs" role="tablist">
|
2017-12-09 13:17:15 +01:00
|
|
|
<li role="presentation" class="active"><a href="#tab-access" aria-controls="tab-access" role="tab" data-toggle="tab"><?=$lang['admin']['access'];?></a></li>
|
|
|
|
<li role="presentation"><a href="#tab-config" aria-controls="tab-config" role="tab" data-toggle="tab"><?=$lang['admin']['configuration'];?></a></li>
|
2017-05-08 00:27:35 +02:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content" style="padding-top:20px">
|
|
|
|
<div role="tabpanel" class="tab-pane active" id="tab-access">
|
2017-03-02 11:23:23 +01:00
|
|
|
<div class="panel panel-danger">
|
|
|
|
<div class="panel-heading"><?=$lang['admin']['admin_details'];?></div>
|
|
|
|
<div class="panel-body">
|
2017-05-23 22:23:46 +02:00
|
|
|
<form class="form-horizontal" autocapitalize="none" data-id="admin" autocorrect="off" role="form" method="post">
|
2017-03-02 11:23:23 +01:00
|
|
|
<?php $admindetails = get_admin_details(); ?>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="admin_user"><?=$lang['admin']['admin'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="text" class="form-control" name="admin_user" id="admin_user" value="<?=htmlspecialchars($admindetails['username']);?>" required>
|
|
|
|
↳ <kbd>a-z A-Z - _ .</kbd>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="admin_pass"><?=$lang['admin']['password'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="password" class="form-control" name="admin_pass" id="admin_pass" placeholder="<?=$lang['admin']['unchanged_if_empty'];?>">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="admin_pass2"><?=$lang['admin']['password_repeat'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="password" class="form-control" name="admin_pass2" id="admin_pass2">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-3 col-sm-9">
|
2018-01-16 22:09:25 +01:00
|
|
|
<button class="btn btn-default" id="edit_selected" data-id="admin" data-item="admin" data-api-url='edit/self' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<hr>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-3 col-xs-5 text-right"><?=$lang['tfa']['tfa'];?>:</div>
|
|
|
|
<div class="col-sm-9 col-xs-7">
|
|
|
|
<p id="tfa_pretty"><?=$tfa_data['pretty'];?></p>
|
|
|
|
<div id="tfa_additional">
|
2017-05-16 11:59:20 +02:00
|
|
|
<?php if (!empty($tfa_data['additional'])):
|
2017-03-02 11:23:23 +01:00
|
|
|
foreach ($tfa_data['additional'] as $key_info): ?>
|
|
|
|
<form style="display:inline;" method="post">
|
|
|
|
<input type="hidden" name="unset_tfa_key" value="<?=$key_info['id'];?>" />
|
|
|
|
<div style="padding:4px;margin:4px" class="label label-<?=($_SESSION['tfa_id'] == $key_info['id']) ? 'success' : 'default'; ?>">
|
|
|
|
<?=$key_info['key_id'];?>
|
|
|
|
<a href="#" style="font-weight:bold;color:white" onClick="$(this).closest('form').submit()">[<?=strtolower($lang['admin']['remove']);?>]</a>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<?php endforeach;
|
|
|
|
endif;?>
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-3 col-xs-5 text-right"><?=$lang['tfa']['set_tfa'];?>:</div>
|
|
|
|
<div class="col-sm-9 col-xs-7">
|
|
|
|
<select data-width="auto" id="selectTFA" class="selectpicker" title="<?=$lang['tfa']['select'];?>">
|
|
|
|
<option value="yubi_otp"><?=$lang['tfa']['yubi_otp'];?></option>
|
|
|
|
<option value="u2f"><?=$lang['tfa']['u2f'];?></option>
|
2017-05-03 18:05:35 +02:00
|
|
|
<option value="totp"><?=$lang['tfa']['totp'];?></option>
|
2017-03-02 11:23:23 +01:00
|
|
|
<option value="none"><?=$lang['tfa']['none'];?></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-12-09 13:17:15 +01:00
|
|
|
|
2018-01-12 08:23:55 +01:00
|
|
|
<div class="hidden panel panel-primary">
|
2017-12-09 13:17:15 +01:00
|
|
|
<div class="panel-heading">API</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<form class="form-horizontal" autocapitalize="none" autocorrect="off" role="form" method="post">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="allow_from"><?=$lang['admin']['api_allow_from'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<textarea class="form-control" rows="5" name="allow_from" id="allow_from" required><?=htmlspecialchars($admindetails['allow_from']);?></textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="admin_api_key"><?=$lang['admin']['api_key'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="text" class="form-control" placeholder="-" value="<?=htmlspecialchars($admindetails['api_key']);?>" readonly>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-3 col-sm-9">
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" name="active" <?=($admindetails['api_active'] == 1) ? 'checked' : null;?>> <?=$lang['admin']['activate_api'];?>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-3 col-sm-9">
|
|
|
|
<div class="btn-group">
|
|
|
|
<button class="btn btn-default" name="admin_api" type="submit" href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
|
|
|
<button class="btn btn-info" name="admin_api_regen_key" type="submit" href="#"><?=$lang['admin']['regen_api_key'];?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-03-02 11:23:23 +01:00
|
|
|
<div class="panel panel-default">
|
2017-05-23 22:23:46 +02:00
|
|
|
<div class="panel-heading"><?=$lang['admin']['domain_admins'];?></div>
|
2017-03-02 11:23:23 +01:00
|
|
|
<div class="panel-body">
|
2017-05-23 22:23:46 +02:00
|
|
|
<div class="table-responsive">
|
2017-05-06 23:52:40 +02:00
|
|
|
<table class="table table-striped" id="domainadminstable"></table>
|
2017-05-23 22:23:46 +02:00
|
|
|
</div>
|
|
|
|
<div class="mass-actions-admin">
|
|
|
|
<div class="btn-group">
|
|
|
|
<a class="btn btn-sm btn-default" id="toggle_multi_select_all" data-id="domain_admins" href="#"><span class="glyphicon glyphicon-check" aria-hidden="true"></span> <?=$lang['mailbox']['toggle_all'];?></a>
|
|
|
|
<a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a>
|
|
|
|
<ul class="dropdown-menu">
|
2017-05-29 21:51:06 +02:00
|
|
|
<li><a id="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"active":"1"}' href="#"><?=$lang['mailbox']['activate'];?></a></li>
|
|
|
|
<li><a id="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"active":"0"}' href="#"><?=$lang['mailbox']['deactivate'];?></a></li>
|
2017-05-23 22:23:46 +02:00
|
|
|
<li role="separator" class="divider"></li>
|
2017-05-29 21:51:06 +02:00
|
|
|
<li><a id="edit_selected" data-id="domain_admins" data-api-url='edit/domain-admin' data-api-attr='{"disable_tfa":"1"}' href="#"><?=$lang['tfa']['disable_tfa'];?></a></li>
|
2017-05-23 22:23:46 +02:00
|
|
|
<li role="separator" class="divider"></li>
|
2017-05-29 21:51:06 +02:00
|
|
|
<li><a id="delete_selected" data-id="domain_admins" data-api-url='delete/domain-admin' href="#"><?=$lang['mailbox']['remove'];?></a></li>
|
2017-05-23 22:23:46 +02:00
|
|
|
</ul>
|
2017-05-29 21:51:06 +02:00
|
|
|
<a class="btn btn-sm btn-success" data-id="add_domain_admin" data-toggle="modal" data-target="#addDomainAdminModal" href="#"><span class="glyphicon glyphicon-plus"></span> <?=$lang['admin']['add_domain_admin'];?></a>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2017-05-23 22:23:46 +02:00
|
|
|
</div>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-23 23:50:22 +02:00
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">Rspamd UI</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<form class="form-horizontal" autocapitalize="none" data-id="admin" autocorrect="off" role="form" method="post">
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-3 col-sm-9">
|
|
|
|
<label>
|
|
|
|
<a href="/rspamd/" target="_blank"><span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> Rspamd UI</a>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="rspamd_ui_pass"><?=$lang['admin']['password'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="password" class="form-control" name="rspamd_ui_pass" id="rspamd_ui_pass" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-3" for="rspamd_ui_pass2"><?=$lang['admin']['password_repeat'];?>:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<input type="password" class="form-control" name="rspamd_ui_pass2" id="rspamd_ui_pass2" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-3 col-sm-9">
|
|
|
|
<button type="submit" class="btn btn-default" id="rspamd_ui" name="rspamd_ui" href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<img class="img-responsive" src="/img/rspamd_logo.png" alt="Rspamd UI" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
|
|
|
|
2017-05-08 00:27:35 +02:00
|
|
|
<div role="tabpanel" class="tab-pane" id="tab-config">
|
2017-07-22 20:39:54 +02:00
|
|
|
<div class="row">
|
2017-07-29 10:32:17 +02:00
|
|
|
<div id="sidebar-admin" class="col-sm-2 hidden-xs">
|
2017-07-22 20:39:54 +02:00
|
|
|
<div id="scrollbox" class="list-group">
|
|
|
|
<a href="#dkim" class="list-group-item"><?=$lang['admin']['dkim_keys'];?></a>
|
|
|
|
<a href="#fwdhosts" class="list-group-item"><?=$lang['admin']['forwarding_hosts'];?></a>
|
|
|
|
<a href="#f2bparams" class="list-group-item"><?=$lang['admin']['f2b_parameters'];?></a>
|
|
|
|
<a href="#relayhosts" class="list-group-item">Relayhosts</a>
|
2018-02-08 20:13:36 +01:00
|
|
|
<a href="#quarantine" class="list-group-item"><?=$lang['admin']['quarantine'];?></a>
|
2018-06-23 23:50:22 +02:00
|
|
|
<a href="#rsettings" class="list-group-item">Rspamd settings map</a>
|
2017-10-21 10:07:06 +02:00
|
|
|
<a href="#customize" class="list-group-item"><?=$lang['admin']['customize'];?></a>
|
2017-07-22 20:39:54 +02:00
|
|
|
<a href="#top" class="list-group-item" style="border-top:1px dashed #dadada">↸ <?=$lang['admin']['to_top'];?></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<span class="anchor" id="dkim"></span>
|
2017-05-08 00:27:35 +02:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading"><?=$lang['admin']['dkim_keys'];?></div>
|
|
|
|
<div class="panel-body">
|
2017-05-11 23:10:32 +02:00
|
|
|
<div class="mass-actions-admin">
|
|
|
|
<div class="btn-group btn-group-sm">
|
|
|
|
<button type="button" id="toggle_multi_select_all" data-id="dkim" class="btn btn-default"><?=$lang['mailbox']['toggle_all'];?></button>
|
|
|
|
<button type="button" id="delete_selected" name="delete_selected" data-id="dkim" data-api-url="delete/dkim" class="btn btn-danger"><?=$lang['admin']['remove'];?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<?php
|
2017-05-23 09:36:59 +02:00
|
|
|
foreach(mailbox('get', 'domains') as $domain) {
|
2017-05-26 23:02:04 +02:00
|
|
|
if (!empty($dkim = dkim('details', $domain))) {
|
2018-08-21 17:41:04 +02:00
|
|
|
$dkim_domains[] = $domain;
|
|
|
|
($GLOBALS['SHOW_DKIM_PRIV_KEYS'] === true) ?: $dkim['privkey'] = base64_encode('Please set $SHOW_DKIM_PRIV_KEYS to true to show DKIM private keys.');
|
2017-05-08 00:27:35 +02:00
|
|
|
?>
|
|
|
|
<div class="row">
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="<?=$domain;?>" /></div>
|
|
|
|
<div class="col-md-3">
|
2017-09-17 14:38:05 +02:00
|
|
|
<p>Domain: <strong><?=htmlspecialchars($domain);?></strong>
|
2018-01-25 13:22:17 +01:00
|
|
|
<p class="dkim-label"><span class="label label-success"><?=$lang['admin']['dkim_key_valid'];?></span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-primary">Selector '<?=$dkim['dkim_selector'];?>'</span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-info"><?=$dkim['length'];?> bit</span></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-8">
|
2017-05-08 00:27:35 +02:00
|
|
|
<pre><?=$dkim['dkim_txt'];?></pre>
|
2017-09-16 22:59:42 +02:00
|
|
|
<p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="<?=$dkim['privkey'];?>"><small>↪ Private key</small></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<hr class="visible-xs visible-sm">
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
?>
|
2017-03-02 11:23:23 +01:00
|
|
|
<div class="row">
|
2018-08-21 17:41:04 +02:00
|
|
|
<div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="<?=$domain;?>" disabled /></div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-3">
|
2017-05-08 00:27:35 +02:00
|
|
|
<p>Domain: <strong><?=htmlspecialchars($domain);?></strong><br /><span class="label label-danger"><?=$lang['admin']['dkim_key_missing'];?></span></p>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-8"><pre>-</pre></div>
|
|
|
|
<hr class="visible-xs visible-sm">
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
2017-05-26 23:02:04 +02:00
|
|
|
foreach(mailbox('get', 'alias_domains', $domain) as $alias_domain) {
|
|
|
|
if (!empty($dkim = dkim('details', $alias_domain))) {
|
2018-08-21 17:41:04 +02:00
|
|
|
$dkim_domains[] = $alias_domain;
|
|
|
|
($GLOBALS['SHOW_DKIM_PRIV_KEYS'] === true) ?: $dkim['privkey'] = base64_encode('Please set $SHOW_DKIM_PRIV_KEYS to true to show DKIM private keys.');
|
2017-05-08 00:27:35 +02:00
|
|
|
?>
|
|
|
|
<div class="row">
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="<?=$alias_domain;?>" /></div>
|
|
|
|
<div class="col-md-2 col-md-offset-1">
|
2017-09-17 14:38:05 +02:00
|
|
|
<p><small>↳ Alias-Domain: <strong><?=htmlspecialchars($alias_domain);?></strong></small>
|
2018-01-25 13:22:17 +01:00
|
|
|
<p class="dkim-label"><span class="label label-success"><?=$lang['admin']['dkim_key_valid'];?></span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-primary">Selector '<?=$dkim['dkim_selector'];?>'</span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-info"><?=$dkim['length'];?> bit</span></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-8">
|
2017-05-08 00:27:35 +02:00
|
|
|
<pre><?=$dkim['dkim_txt'];?></pre>
|
2017-09-16 22:59:42 +02:00
|
|
|
<p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="<?=$dkim['privkey'];?>"><small>↪ Private key</small></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<hr class="visible-xs visible-sm">
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
?>
|
|
|
|
<div class="row">
|
2018-08-21 17:41:04 +02:00
|
|
|
<div class="col-md-1"><input class="dkim_missing" type="checkbox" data-id="dkim" name="multi_select" value="<?=$alias_domain;?>" disabled /></div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-2 col-md-offset-1">
|
2017-05-08 00:27:35 +02:00
|
|
|
<p><small>↳ Alias-Domain: <strong><?=htmlspecialchars($alias_domain);?></strong><br /></small><span class="label label-danger"><?=$lang['admin']['dkim_key_missing'];?></span></p>
|
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-8"><pre>-</pre></div>
|
|
|
|
<hr class="visible-xs visible-sm">
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-05-26 23:02:04 +02:00
|
|
|
foreach(dkim('blind') as $blind) {
|
|
|
|
if (!empty($dkim = dkim('details', $blind))) {
|
2018-08-21 17:41:04 +02:00
|
|
|
$dkim_domains[] = $blind;
|
|
|
|
($GLOBALS['SHOW_DKIM_PRIV_KEYS'] === true) ?: $dkim['privkey'] = base64_encode('Please set $SHOW_DKIM_PRIV_KEYS to true to show DKIM private keys.');
|
2017-05-08 00:27:35 +02:00
|
|
|
?>
|
|
|
|
<div class="row">
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-1"><input type="checkbox" data-id="dkim" name="multi_select" value="<?=$blind;?>" /></div>
|
|
|
|
<div class="col-md-3">
|
2017-09-17 14:38:05 +02:00
|
|
|
<p>Domain: <strong><?=htmlspecialchars($blind);?></strong>
|
2018-01-25 13:22:17 +01:00
|
|
|
<p class="dkim-label"><span class="label label-warning"><?=$lang['admin']['dkim_key_unused'];?></span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-primary">Selector '<?=$dkim['dkim_selector'];?>'</span></p>
|
|
|
|
<p class="dkim-label"><span class="label label-info"><?=$dkim['length'];?> bit</span></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<div class="col-md-8">
|
2017-05-08 00:27:35 +02:00
|
|
|
<pre><?=$dkim['dkim_txt'];?></pre>
|
2017-09-16 22:59:42 +02:00
|
|
|
<p data-toggle="modal" data-target="#showDKIMprivKey" id="dkim_priv" style="cursor:pointer;margin-top:-8pt" data-priv-key="<?=$dkim['privkey'];?>"><small>↪ Private key</small></p>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<hr class="visible-xs visible-sm">
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<?php
|
|
|
|
}
|
2017-03-02 11:23:23 +01:00
|
|
|
}
|
|
|
|
?>
|
2017-05-09 21:30:08 +02:00
|
|
|
|
2017-05-08 00:27:35 +02:00
|
|
|
<legend style="margin-top:40px"><?=$lang['admin']['dkim_add_key'];?></legend>
|
2017-12-17 17:57:57 +01:00
|
|
|
<form class="form" data-id="dkim" role="form" method="post">
|
2017-05-08 00:27:35 +02:00
|
|
|
<div class="form-group">
|
2018-08-21 17:41:04 +02:00
|
|
|
<label for="domain"><?=$lang['admin']['domain_s'];?></label>
|
|
|
|
<input class="form-control input-sm" id="dkim_add_domains" name="domains" placeholder="example.org, example.com" required>
|
|
|
|
<small>↪ <a href="#" id="dkim_missing_keys"><?=$lang['admin']['dkim_domains_wo_keys'];?></a></small>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="domain">Selector</label>
|
2018-08-21 17:41:04 +02:00
|
|
|
<input class="form-control input-sm" id="dkim_selector" name="dkim_selector" value="dkim" required>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-08-21 17:41:04 +02:00
|
|
|
<select data-width="200px" data-style="btn btn-default btn-sm" class="form-control" id="key_size" name="key_size" title="<?=$lang['admin']['dkim_key_length'];?>" required>
|
2017-05-08 00:27:35 +02:00
|
|
|
<option data-subtext="bits">1024</option>
|
|
|
|
<option data-subtext="bits">2048</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
2018-08-21 17:41:04 +02:00
|
|
|
<button class="btn btn-sm btn-default" id="add_item" data-id="dkim" data-api-url='add/dkim' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus"></span> <?=$lang['admin']['add'];?></button>
|
2017-05-08 00:27:35 +02:00
|
|
|
</form>
|
2017-06-30 21:50:21 +02:00
|
|
|
|
2018-08-21 17:41:04 +02:00
|
|
|
<legend data-target="#import_dkim" style="margin-top:40px;cursor:pointer" id="import_dkim_legend" unselectable="on" data-toggle="collapse">
|
|
|
|
<span id="import_dkim_arrow" style="font-size:12px" class="rotate glyphicon glyphicon-menu-down"></span> <?=$lang['admin']['import_private_key'];?>
|
|
|
|
</legend>
|
2017-06-30 21:50:21 +02:00
|
|
|
<div id="import_dkim" class="collapse">
|
|
|
|
<form class="form" data-id="dkim_import" role="form" method="post">
|
|
|
|
<div class="form-group">
|
2017-07-01 23:12:14 +02:00
|
|
|
<label for="domain">Domain:</label>
|
2018-08-21 17:41:04 +02:00
|
|
|
<input class="form-control input-sm" id="domain" name="domain" placeholder="example.org" required>
|
2017-06-30 21:50:21 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-07-01 23:12:14 +02:00
|
|
|
<label for="domain">Selector:</label>
|
2018-08-21 17:41:04 +02:00
|
|
|
<input class="form-control input-sm" id="dkim_selector" name="dkim_selector" value="dkim" required>
|
2017-06-30 21:50:21 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-07-01 23:12:14 +02:00
|
|
|
<label for="private_key_file"><?=$lang['admin']['private_key'];?>:</label>
|
2018-08-21 17:41:04 +02:00
|
|
|
<textarea class="form-control input-sm" rows="10" name="private_key_file" id="private_key_file" required placeholder="-----BEGIN RSA KEY-----"></textarea>
|
2017-06-30 21:50:21 +02:00
|
|
|
</div>
|
2018-08-21 17:41:04 +02:00
|
|
|
<button class="btn btn-sm btn-default" id="add_item" data-id="dkim_import" data-api-url='add/dkim_import' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus"></span> <?=$lang['admin']['import'];?></button>
|
2017-06-30 21:50:21 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
2018-08-21 17:41:04 +02:00
|
|
|
|
|
|
|
<legend data-target="#duplicate_dkim" style="margin-top:40px;cursor:pointer" id="duplicate_dkim_legend" unselectable="on" data-toggle="collapse">
|
|
|
|
<span id="duplicate_dkim_arrow" style="font-size:12px" class="rotate glyphicon glyphicon-menu-down"></span> <?=$lang['admin']['duplicate_dkim'];?>
|
|
|
|
</legend>
|
|
|
|
<div id="duplicate_dkim" class="collapse">
|
|
|
|
<form class="form-horizontal" data-id="dkim_duplicate" role="form" method="post">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-2" for="from_domain"><?=$lang['admin']['dkim_from'];?>:</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<select data-style="btn btn-default btn-sm"
|
|
|
|
data-live-search="true"
|
|
|
|
data-id="dkim_duplicate"
|
|
|
|
title="<?=$lang['admin']['dkim_from_title'];?>"
|
|
|
|
name="from_domain" id="from_domain" class="full-width-select form-control" required>
|
|
|
|
<?php
|
|
|
|
foreach ($dkim_domains as $dkim) {
|
|
|
|
?>
|
|
|
|
<option value="<?=$dkim;?>"><?=$dkim;?></option>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="control-label col-sm-2" for="to_domain"><?=$lang['admin']['dkim_to'];?>:</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<select
|
|
|
|
data-live-search="true"
|
|
|
|
data-style="btn btn-default btn-sm"
|
|
|
|
data-id="dkim_duplicate"
|
|
|
|
title="<?=$lang['admin']['dkim_to_title'];?>"
|
|
|
|
name="to_domain" id="to_domain" class="full-width-select form-control" multiple required>
|
|
|
|
<?php
|
|
|
|
foreach (array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains')) as $domain) {
|
|
|
|
?>
|
|
|
|
<option value="<?=$domain;?>"><?=$domain;?></option>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<button class="btn btn-sm btn-default" id="add_item" data-id="dkim_duplicate" data-api-url='add/dkim_duplicate' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-duplicate"></span> <?=$lang['admin']['duplicate'];?></button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2017-03-02 11:23:23 +01:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
2017-07-16 11:03:28 +02:00
|
|
|
|
2017-07-22 20:39:54 +02:00
|
|
|
<span class="anchor" id="fwdhosts"></span>
|
2017-05-08 00:27:35 +02:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading"><?=$lang['admin']['forwarding_hosts'];?></div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<p style="margin-bottom:40px"><?=$lang['admin']['forwarding_hosts_hint'];?></p>
|
2017-05-26 23:02:04 +02:00
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-striped table-condensed" id="forwardinghoststable"></table>
|
|
|
|
</div>
|
2017-05-11 23:10:32 +02:00
|
|
|
<div class="mass-actions-admin">
|
|
|
|
<div class="btn-group btn-group-sm">
|
|
|
|
<button type="button" id="toggle_multi_select_all" data-id="fwdhosts" class="btn btn-default"><?=$lang['mailbox']['toggle_all'];?></button>
|
2017-05-26 23:02:04 +02:00
|
|
|
<a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li><a id="edit_selected" data-id="fwdhosts" data-api-url='edit/fwdhost' data-api-attr='{"keep_spam":"0"}' href="#">Enable spam filter</a></li>
|
|
|
|
<li><a id="edit_selected" data-id="fwdhosts" data-api-url='edit/fwdhost' data-api-attr='{"keep_spam":"1"}' href="#">Disable spam filter</a></li>
|
|
|
|
<li role="separator" class="divider"></li>
|
|
|
|
<li><a id="delete_selected" data-id="fwdhosts" data-api-url='delete/fwdhost' href="#"><?=$lang['admin']['remove'];?></a></li>
|
|
|
|
</ul>
|
2017-05-11 23:10:32 +02:00
|
|
|
</div>
|
2017-05-09 13:43:54 +02:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<legend><?=$lang['admin']['add_forwarding_host'];?></legend>
|
|
|
|
<p class="help-block"><?=$lang['admin']['forwarding_hosts_add_hint'];?></p>
|
2017-12-17 17:57:57 +01:00
|
|
|
<form class="form" data-id="fwdhost" role="form" method="post">
|
2017-05-08 07:39:30 +02:00
|
|
|
<div class="form-group">
|
2017-05-11 23:10:32 +02:00
|
|
|
<label for="hostname"><?=$lang['admin']['host'];?></label>
|
2017-05-08 23:09:40 +02:00
|
|
|
<input class="form-control" id="hostname" name="hostname" placeholder="example.org" required>
|
2017-04-17 13:16:54 +02:00
|
|
|
</div>
|
2017-05-08 00:27:35 +02:00
|
|
|
<div class="form-group">
|
2017-05-08 23:09:40 +02:00
|
|
|
<select data-width="200px" class="form-control" id="filter_spam" name="filter_spam" title="<?=$lang['user']['spamfilter'];?>" required>
|
|
|
|
<option value="1"><?=$lang['admin']['active'];?></option>
|
|
|
|
<option value="0"><?=$lang['admin']['inactive'];?></option>
|
|
|
|
</select>
|
2017-05-08 00:27:35 +02:00
|
|
|
</div>
|
2017-05-26 23:02:04 +02:00
|
|
|
<button class="btn btn-default" id="add_item" data-id="fwdhost" data-api-url='add/fwdhost' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus"></span> <?=$lang['admin']['add'];?></button>
|
2017-05-08 00:27:35 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
2017-04-17 13:16:54 +02:00
|
|
|
</div>
|
2017-06-25 21:33:26 +02:00
|
|
|
|
2017-07-22 20:39:54 +02:00
|
|
|
<span class="anchor" id="f2bparams"></span>
|
2017-06-25 21:33:26 +02:00
|
|
|
<div class="panel panel-default">
|
2017-06-29 10:30:25 +02:00
|
|
|
<div class="panel-heading"><?=$lang['admin']['f2b_parameters'];?></div>
|
2017-06-25 21:33:26 +02:00
|
|
|
<div class="panel-body">
|
|
|
|
<?php
|
2017-06-29 10:29:56 +02:00
|
|
|
$f2b_data = fail2ban('get');
|
2017-06-25 21:33:26 +02:00
|
|
|
?>
|
|
|
|
<form class="form" data-id="f2b" role="form" method="post">
|
|
|
|
<div class="form-group">
|
2017-06-29 10:30:25 +02:00
|
|
|
<label for="ban_time"><?=$lang['admin']['f2b_ban_time'];?>:</label>
|
2017-06-25 21:33:26 +02:00
|
|
|
<input type="number" class="form-control" id="ban_time" name="ban_time" value="<?=$f2b_data['ban_time'];?>" required>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-06-29 10:30:25 +02:00
|
|
|
<label for="max_attempts"><?=$lang['admin']['f2b_max_attempts'];?>:</label>
|
2017-06-25 21:33:26 +02:00
|
|
|
<input type="number" class="form-control" id="max_attempts" name="max_attempts" value="<?=$f2b_data['max_attempts'];?>" required>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2017-06-29 10:30:25 +02:00
|
|
|
<label for="retry_window"><?=$lang['admin']['f2b_retry_window'];?>:</label>
|
2017-06-25 21:33:26 +02:00
|
|
|
<input type="number" class="form-control" id="retry_window" name="retry_window" value="<?=$f2b_data['retry_window'];?>" required>
|
|
|
|
</div>
|
2018-01-24 09:25:28 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="netban_ipv4"><?=$lang['admin']['f2b_netban_ipv4'];?>:</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon">/</span>
|
|
|
|
<input type="number" class="form-control" id="netban_ipv4" name="netban_ipv4" value="<?=$f2b_data['netban_ipv4'];?>" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="netban_ipv6"><?=$lang['admin']['f2b_netban_ipv6'];?>:</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<span class="input-group-addon">/</span>
|
|
|
|
<input type="number" class="form-control" id="netban_ipv6" name="netban_ipv6" value="<?=$f2b_data['netban_ipv6'];?>" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-04-25 10:54:13 +02:00
|
|
|
<p class="help-block"><?=$lang['admin']['f2b_list_info'];?></p>
|
2017-06-26 23:18:05 +02:00
|
|
|
<div class="form-group">
|
2017-12-09 13:17:15 +01:00
|
|
|
<label for="whitelist"><?=$lang['admin']['f2b_whitelist'];?>:</label>
|
2017-06-26 23:18:05 +02:00
|
|
|
<textarea class="form-control" id="whitelist" name="whitelist" rows="5"><?=$f2b_data['whitelist'];?></textarea>
|
|
|
|
</div>
|
2018-04-25 10:54:13 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="blacklist"><?=$lang['admin']['f2b_blacklist'];?>:</label>
|
|
|
|
<textarea class="form-control" id="blacklist" name="blacklist" rows="5"><?=$f2b_data['blacklist'];?></textarea>
|
|
|
|
</div>
|
2018-07-09 20:13:02 +02:00
|
|
|
<div class="btn-group">
|
|
|
|
<button class="btn btn-default" id="edit_selected" data-item="self" data-id="f2b" data-api-url='edit/fail2ban' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
|
|
|
<a href="#" role="button" class="btn btn-default" data-toggle="modal" data-container="netfilter-mailcow" data-target="#RestartContainer"><span class="glyphicon glyphicon-refresh"></span> <?= $lang['header']['restart_netfilter']; ?></a>
|
|
|
|
</div>
|
2017-06-25 21:33:26 +02:00
|
|
|
</form>
|
2018-07-03 23:27:00 +02:00
|
|
|
<hr>
|
|
|
|
<p class="help-block"><?=$lang['admin']['ban_list_info'];?></p>
|
|
|
|
<?php
|
2018-07-09 20:13:02 +02:00
|
|
|
if (empty($f2b_data['active_bans']) && empty($f2b_data['perm_bans'])):
|
2018-07-03 23:27:00 +02:00
|
|
|
?>
|
|
|
|
<i><?=$lang['admin']['no_active_bans'];?></i>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
foreach ($f2b_data['active_bans'] as $active_bans):
|
|
|
|
?>
|
|
|
|
<p><span class="label label-info" style="padding:4px;font-size:85%;"><span class="glyphicon glyphicon-filter"></span> <?=$active_bans['network'];?> (<?=$active_bans['banned_until'];?>) -
|
|
|
|
<?php
|
|
|
|
if ($active_bans['queued_for_unban'] == 0):
|
|
|
|
?>
|
|
|
|
<a id="edit_selected" data-item="<?=$active_bans['network'];?>" data-id="f2b-quick" data-api-url='edit/fail2ban' data-api-attr='{"action":"unban"}' href="#">[<?=$lang['admin']['queue_unban'];?>]</a>
|
|
|
|
<a id="edit_selected" data-item="<?=$active_bans['network'];?>" data-id="f2b-quick" data-api-url='edit/fail2ban' data-api-attr='{"action":"whitelist"}' href="#">[whitelist]</a>
|
|
|
|
<a id="edit_selected" data-item="<?=$active_bans['network'];?>" data-id="f2b-quick" data-api-url='edit/fail2ban' data-api-attr='{"action":"blacklist"}' href="#">[blacklist]</a>
|
|
|
|
<?php
|
|
|
|
else:
|
|
|
|
?>
|
|
|
|
<i><?=$lang['admin']['unban_pending'];?></i>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
</span></p>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
2018-07-09 20:13:02 +02:00
|
|
|
foreach ($f2b_data['perm_bans'] as $perm_bans):
|
|
|
|
?>
|
|
|
|
<p>
|
|
|
|
<span class="label label-danger" style="padding:4px;font-size:85%;"><span class="glyphicon glyphicon-filter"></span> <?=$perm_bans?></span>
|
|
|
|
</p>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
2018-07-03 23:27:00 +02:00
|
|
|
?>
|
2017-06-25 21:33:26 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-22 20:39:54 +02:00
|
|
|
|
|
|
|
<span class="anchor" id="relayhosts"></span>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">Relayhosts</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<p style="margin-bottom:40px"><?=$lang['admin']['relayhosts_hint'];?></p>
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-striped table-condensed" id="relayhoststable"></table>
|
|
|
|
</div>
|
|
|
|
<div class="mass-actions-admin">
|
|
|
|
<div class="btn-group btn-group-sm">
|
|
|
|
<button type="button" id="toggle_multi_select_all" data-id="rlyhosts" class="btn btn-default"><?=$lang['mailbox']['toggle_all'];?></button>
|
|
|
|
<a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['mailbox']['quick_actions'];?> <span class="caret"></span></a>
|
|
|
|
<ul class="dropdown-menu">
|
|
|
|
<li><a id="edit_selected" data-id="rlyhosts" data-api-url='edit/relayhost' data-api-attr='{"active":"1"}' href="#"><?=$lang['mailbox']['activate'];?></a></li>
|
|
|
|
<li><a id="edit_selected" data-id="rlyhosts" data-api-url='edit/relayhost' data-api-attr='{"active":"0"}' href="#"><?=$lang['mailbox']['deactivate'];?></a></li>
|
|
|
|
<li role="separator" class="divider"></li>
|
|
|
|
<li><a id="delete_selected" data-id="rlyhosts" data-api-url='delete/relayhost' href="#"><?=$lang['admin']['remove'];?></a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<legend><?=$lang['admin']['add_relayhost'];?></legend>
|
|
|
|
<p class="help-block"><?=$lang['admin']['add_relayhost_add_hint'];?></p>
|
2017-12-17 17:57:57 +01:00
|
|
|
<form class="form" data-id="rlyhost" role="form" method="post">
|
2017-07-22 20:39:54 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="hostname"><?=$lang['admin']['host'];?></label>
|
|
|
|
<input class="form-control" id="hostname" name="hostname" required>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="hostname"><?=$lang['admin']['username'];?></label>
|
|
|
|
<input class="form-control" id="username" name="username">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="hostname"><?=$lang['admin']['password'];?></label>
|
|
|
|
<input class="form-control" id="password" name="password">
|
|
|
|
</div>
|
|
|
|
<button class="btn btn-default" id="add_item" data-id="rlyhost" data-api-url='add/relayhost' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus"></span> <?=$lang['admin']['add'];?></button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-10-21 10:07:06 +02:00
|
|
|
|
2018-02-08 20:13:36 +01:00
|
|
|
<span class="anchor" id="quarantine"></span>
|
2017-12-09 13:17:15 +01:00
|
|
|
<div class="panel panel-default">
|
2018-02-08 20:13:36 +01:00
|
|
|
<div class="panel-heading"><?=$lang['admin']['quarantine'];?></div>
|
2017-12-09 13:17:15 +01:00
|
|
|
<div class="panel-body">
|
2018-02-08 20:13:36 +01:00
|
|
|
<?php $q_data = quarantine('settings'); ?>
|
|
|
|
<form class="form" data-id="quarantine" role="form" method="post">
|
2017-12-09 13:17:15 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="form-group">
|
2018-02-08 20:13:36 +01:00
|
|
|
<label for="retention_size"><?=$lang['admin']['quarantine_retention_size'];?></label>
|
2018-06-23 23:50:22 +02:00
|
|
|
<input type="number" class="form-control" id="retention_size" name="retention_size" value="<?=$q_data['retention_size'];?>" placeholder="0" required>
|
2017-12-09 13:17:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="form-group">
|
2018-02-08 20:13:36 +01:00
|
|
|
<label for="max_size"><?=$lang['admin']['quarantine_max_size'];?></label>
|
2018-06-23 23:50:22 +02:00
|
|
|
<input type="number" class="form-control" id="max_size" name="max_size" value="<?=$q_data['max_size'];?>" placeholder="0" required>
|
2017-12-09 13:17:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-02-08 20:13:36 +01:00
|
|
|
<label for="exclude_domains"><?=$lang['admin']['quarantine_exclude_domains'];?></label><br />
|
2017-12-09 13:17:15 +01:00
|
|
|
<select data-width="100%" id="exclude_domains" name="exclude_domains" class="selectpicker" title="<?=$lang['tfa']['select'];?>" multiple>
|
|
|
|
<?php
|
|
|
|
foreach (array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains')) as $domain):
|
|
|
|
?>
|
|
|
|
<option <?=(in_array($domain, $q_data['exclude_domains'])) ? 'selected' : null;?>><?=htmlspecialchars($domain);?></option>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
2018-02-08 20:13:36 +01:00
|
|
|
<button class="btn btn-default" id="edit_selected" data-item="self" data-id="quarantine" data-api-url='edit/quarantine' data-api-attr='{"action":"settings"}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
2017-12-09 13:17:15 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
2018-06-23 23:50:22 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<span class="anchor" id="rsettings"></span>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">Rspamd settings map</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<legend>Active settings map</legend>
|
|
|
|
<textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control" rows="20" id="settings_map" name="settings_map" readonly><?=file_get_contents('http://nginx:8081/settings.php');?></textarea>
|
|
|
|
<hr>
|
|
|
|
<?php $rsettings = rsettings('get'); ?>
|
|
|
|
<form class="form" data-id="rsettings" role="form" method="post">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<div class="list-group">
|
|
|
|
<?php
|
|
|
|
if (empty($rsettings)):
|
|
|
|
?>
|
|
|
|
<span class="list-group-item"><em><?=$lang['admin']['rsetting_none'];?></em></span>
|
|
|
|
<?php
|
|
|
|
else:
|
|
|
|
foreach ($rsettings as $rsetting):
|
|
|
|
$rsetting_details = rsettings('details', $rsetting['id']);
|
|
|
|
?>
|
|
|
|
<a href="#<?=$rsetting_details['id'];?>" class="list-group-item list-group-item-<?=($rsetting_details['active_int'] == '1') ? 'success' : ''; ?>" data-dont-remember="1" data-toggle="tab"><?=$rsetting_details['desc'];?> (ID #<?=$rsetting['id'];?>)</a>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<a href="#" class="list-group-item list-group-item-default"
|
|
|
|
data-id="add_domain_admin"
|
|
|
|
data-toggle="modal"
|
|
|
|
data-dont-remember="1"
|
|
|
|
data-target="#addRsettingModal"
|
|
|
|
data-toggle="tab"><?=$lang['admin']['rsetting_add_rule'];?></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="tab-content">
|
|
|
|
<?php
|
|
|
|
if (empty($rsettings)):
|
|
|
|
?>
|
|
|
|
<div id="none" class="tab-pane active">
|
|
|
|
<p class="help-block"><?=$lang['admin']['rsetting_none'];?></p>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
else:
|
|
|
|
?>
|
|
|
|
<div id="none" class="tab-pane active">
|
|
|
|
<p class="help-block"><?=$lang['admin']['rsetting_no_selection'];?></p>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
foreach ($rsettings as $rsetting):
|
|
|
|
$rsetting_details = rsettings('details', $rsetting['id']);
|
|
|
|
?>
|
|
|
|
<div id="<?=$rsetting_details['id'];?>" class="tab-pane">
|
|
|
|
<form class="form" data-id="rsettings" role="form" method="post">
|
|
|
|
<input type="hidden" name="active" value="0">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="desc"><?=$lang['admin']['rsetting_desc'];?>:</label>
|
|
|
|
<input type="text" class="form-control" id="desc" name="desc" value="<?=$rsetting_details['desc'];?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="content"><?=$lang['admin']['rsetting_content'];?>:</label>
|
|
|
|
<textarea class="form-control" id="content" name="content" rows="10"><?=$rsetting_details['content'];?></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" name="active" value="1" <?=($rsetting_details['active_int'] == 1) ? 'checked' : null;?>> <?=$lang['admin']['active'];?>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<button class="btn btn-default" id="edit_selected" data-item="<?=$rsetting_details['id'];?>" data-id="rsettings" data-api-url='edit/rsetting' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
|
|
|
<button class="btn btn-danger" id="delete_selected" data-item="<?=$rsetting_details['id'];?>" data-id="rsettings" data-api-url="delete/rsetting" data-api-attr='{}' href="#"><?=$lang['admin']['remove'];?></button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2017-12-09 13:17:15 +01:00
|
|
|
</div>
|
|
|
|
|
2017-10-21 10:07:06 +02:00
|
|
|
<span class="anchor" id="customize"></span>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading"><?=$lang['admin']['customize'];?></div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<legend><?=$lang['admin']['change_logo'];?></legend>
|
|
|
|
<p class="help-block"><?=$lang['admin']['logo_info'];?></p>
|
|
|
|
<form class="form-inline" role="form" method="post" enctype="multipart/form-data">
|
|
|
|
<p>
|
|
|
|
<input type="file" name="main_logo" class="filestyle" data-buttonName="btn-default" data-buttonText="Select" accept="image/gif, image/jpeg, image/pjpeg, image/x-png, image/png, image/svg+xml">
|
2018-01-25 13:22:17 +01:00
|
|
|
<button name="submit_main_logo" type="submit" class="btn btn-default"><span class="glyphicon glyphicon-cloud-upload"></span> <?=$lang['admin']['upload'];?></button>
|
2017-10-21 10:07:06 +02:00
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
if ($main_logo = customize('get', 'main_logo')):
|
|
|
|
$specs = customize('get', 'main_logo_specs');
|
|
|
|
?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<div class="thumbnail">
|
|
|
|
<img class="img-thumbnail" src="<?=$main_logo;?>" alt="mailcow logo">
|
|
|
|
<div class="caption">
|
|
|
|
<span class="label label-info"><?=$specs['geometry']['width'];?>x<?=$specs['geometry']['height'];?> px</span>
|
|
|
|
<span class="label label-info"><?=$specs['mimetype'];?></span>
|
|
|
|
<span class="label label-info"><?=$specs['fileSize'];?></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<form class="form-inline" role="form" method="post">
|
|
|
|
<p><button name="reset_main_logo" type="submit" class="btn btn-xs btn-default"><?=$lang['admin']['reset_default'];?></button></p>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
?>
|
|
|
|
<legend><?=$lang['admin']['app_links'];?></legend>
|
|
|
|
<p class="help-block"><?=$lang['admin']['merged_vars_hint'];?></p>
|
|
|
|
<form class="form-inline" data-id="app_links" role="form" method="post">
|
2018-07-12 17:23:52 +02:00
|
|
|
<table class="table table-condensed" style="white-space: nowrap;" id="app_link_table">
|
2017-10-21 10:07:06 +02:00
|
|
|
<tr>
|
|
|
|
<th><?=$lang['admin']['app_name'];?></th>
|
|
|
|
<th><?=$lang['admin']['link'];?></th>
|
|
|
|
<th> </th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
$app_links = customize('get', 'app_links');
|
|
|
|
foreach ($app_links as $row) {
|
|
|
|
foreach ($row as $key => $val):
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><input class="input-sm form-control" data-id="app_links" type="text" name="app" required value="<?=$key;?>"></td>
|
|
|
|
<td><input class="input-sm form-control" data-id="app_links" type="text" name="href" required value="<?=$val;?>"></td>
|
|
|
|
<td><a href="#" role="button" class="btn btn-xs btn-default" type="button"><?=$lang['admin']['remove_row'];?></a></td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
}
|
|
|
|
foreach ($MAILCOW_APPS as $app):
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td><input class="input-sm form-control" value="<?=htmlspecialchars($app['name']);?>" disabled></td>
|
|
|
|
<td><input class="input-sm form-control" value="<?=htmlspecialchars($app['link']);?>" disabled></td>
|
|
|
|
<td> </td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
endforeach;
|
|
|
|
?>
|
|
|
|
</table>
|
2017-12-09 13:17:15 +01:00
|
|
|
<p><div class="btn-group">
|
2018-01-25 13:22:17 +01:00
|
|
|
<button class="btn btn-sm btn-default" id="edit_selected" data-item="admin" data-id="app_links" data-reload="no" data-api-url='edit/app_links' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
2017-12-09 13:17:15 +01:00
|
|
|
<button class="btn btn-sm btn-default" type="button" id="add_app_link_row"><?=$lang['admin']['add_row'];?></button>
|
|
|
|
</div></p>
|
|
|
|
</form>
|
|
|
|
<legend><?=$lang['admin']['ui_texts'];?></legend>
|
|
|
|
<?php
|
|
|
|
$ui_texts = customize('get', 'ui_texts');
|
|
|
|
?>
|
|
|
|
<form class="form" data-id="uitexts" role="form" method="post">
|
2018-01-18 18:23:53 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="title_name"><?=$lang['admin']['title_name'];?>:</label>
|
|
|
|
<input type="text" class="form-control" id="title_name" name="title_name" placeholder="mailcow UI" value="<?=$ui_texts['title_name'];?>">
|
|
|
|
</div>
|
2017-12-09 13:17:15 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="main_name"><?=$lang['admin']['main_name'];?>:</label>
|
|
|
|
<input type="text" class="form-control" id="main_name" name="main_name" placeholder="mailcow UI" value="<?=$ui_texts['main_name'];?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="apps_name"><?=$lang['admin']['apps_name'];?>:</label>
|
|
|
|
<input type="text" class="form-control" id="apps_name" name="apps_name" placeholder="mailcow Apps" value="<?=$ui_texts['apps_name'];?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="help_text"><?=$lang['admin']['help_text'];?>:</label>
|
|
|
|
<textarea class="form-control" id="help_text" name="help_text" rows="7"><?=$ui_texts['help_text'];?></textarea>
|
|
|
|
</div>
|
2018-01-25 13:22:17 +01:00
|
|
|
<button class="btn btn-default" id="edit_selected" data-item="ui" data-id="uitexts" data-api-url='edit/ui_texts' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-check"></span> <?=$lang['admin']['save'];?></button>
|
2017-10-21 10:07:06 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-22 20:39:54 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-04-17 13:16:54 +02:00
|
|
|
</div>
|
2017-04-23 19:37:45 +02:00
|
|
|
|
2017-05-06 23:52:40 +02:00
|
|
|
</div>
|
2017-03-02 11:23:23 +01:00
|
|
|
</div> <!-- /container -->
|
2017-05-29 21:51:06 +02:00
|
|
|
<?php
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/admin.php';
|
|
|
|
?>
|
2017-03-28 11:47:03 +02:00
|
|
|
<script type='text/javascript'>
|
|
|
|
<?php
|
|
|
|
$lang_admin = json_encode($lang['admin']);
|
|
|
|
echo "var lang = ". $lang_admin . ";\n";
|
2017-05-15 11:37:12 +02:00
|
|
|
echo "var csrf_token = '". $_SESSION['CSRF']['TOKEN'] . "';\n";
|
2017-03-28 11:47:03 +02:00
|
|
|
echo "var pagination_size = '". $PAGINATION_SIZE . "';\n";
|
2017-05-29 21:51:06 +02:00
|
|
|
echo "var log_pagination_size = '". $LOG_PAGINATION_SIZE . "';\n";
|
2017-03-28 11:47:03 +02:00
|
|
|
?>
|
|
|
|
</script>
|
|
|
|
<script src="js/footable.min.js"></script>
|
2017-03-02 11:23:23 +01:00
|
|
|
<script src="js/admin.js"></script>
|
|
|
|
<?php
|
2017-05-29 21:51:06 +02:00
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
2017-03-02 11:23:23 +01:00
|
|
|
} else {
|
|
|
|
header('Location: /');
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
?>
|