blob: 6343db4001c7c1a4832e9dfde3381a83c803e5d3 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001<?php
2require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
3
4if (isset($_SESSION['mailcow_cc_role'])) {
5require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php';
6$_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +02007$quarantine_settings = quarantine('settings');
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01008?>
9<div class="container">
10 <div class="row">
11 <div class="col-md-12">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020012 <div class="panel panel-default panel-xs-lg">
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010013 <div class="panel-heading">
14 <?=$lang['quarantine']['quarantine'];?> <span class="badge badge-info table-lines"></span>
15 <div class="btn-group pull-right">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020016 <button class="btn btn-xs btn-xs-lg btn-default refresh_table" data-draw="draw_quarantine_table" data-table="quarantinetable"><?=$lang['quarantine']['refresh'];?></button>
17 <button type="button" class="btn btn-xs btn-xs-lg btn-default dropdown-toggle" data-toggle="dropdown"><?=$lang['quarantine']['table_size'];?>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010018 <span class="caret"></span>
19 </button>
20 <ul class="dropdown-menu" data-table-id="quarantinetable" role="menu">
21 <li><a href="#" data-page-size="10"><?=sprintf($lang['quarantine']['table_size_show_n'], 10);?></a></li>
22 <li><a href="#" data-page-size="20"><?=sprintf($lang['quarantine']['table_size_show_n'], 20);?></a></li>
23 <li><a href="#" data-page-size="50"><?=sprintf($lang['quarantine']['table_size_show_n'], 50);?></a></li>
24 <li><a href="#" data-page-size="100"><?=sprintf($lang['quarantine']['table_size_show_n'], 100);?></a></li>
25 <li><a href="#" data-page-size="200"><?=sprintf($lang['quarantine']['table_size_show_n'], 200);?></a></li>
26 <li><a href="#" data-page-size="500"><?=sprintf($lang['quarantine']['table_size_show_n'], 500);?></a></li>
27 </ul>
28 </div>
29 </div>
30 <p style="margin:10px" class="help-block"><?=$lang['quarantine']['qinfo'];?></p>
31 <p style="margin:10px">
32 <?php
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020033 if (empty($quarantine_settings['retention_size'] || $quarantine_settings['max_size'])) {
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010034 ?>
35 <div class="panel-body"><div class="alert alert-info"><?=$lang['quarantine']['disabled_by_config'];?></div></div>
36 <?php
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020037 }
38 else {
39 ?>
40 <p style="margin:10px" class="help-block"><?=sprintf($lang['quarantine']['settings_info'], $quarantine_settings['retention_size'], $quarantine_settings['max_size']);?></p>
41 <?php
42 }
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010043 ?>
44 </p>
45 <div class="table-responsive">
46 <table id="quarantinetable" class="table table-striped"></table>
47 </div>
48 <div class="mass-actions-quarantine">
49 <div class="btn-group" data-acl="<?=$_SESSION['acl']['quarantine'];?>">
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020050 <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="toggle_multi_select_all" data-id="qitems" href="#"><i class="bi bi-check-all"></i> <?=$lang['quarantine']['toggle_all'];?></a>
51 <a class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['quarantine']['quick_actions'];?> <span class="caret"></span></a>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010052 <ul class="dropdown-menu">
53 <li><a data-action="edit_selected" data-id="qitems" data-api-url='edit/qitem' data-api-attr='{"action":"release"}' href="#"><?=$lang['quarantine']['deliver_inbox'];?></a></li>
54 <li role="separator" class="divider"></li>
55 <li><a data-action="edit_selected" data-id="qitems" data-api-url='edit/qitem' data-api-attr='{"action":"learnspam"}' href="#"><?=$lang['quarantine']['learn_spam_delete'];?></a></li>
56 <li role="separator" class="divider"></li>
57 <li><a data-action="delete_selected" data-id="qitems" data-api-url='delete/qitem' href="#"><?=$lang['quarantine']['remove'];?></a></li>
58 </ul>
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020059 <div class="clearfix visible-xs"></div>
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010060 </div>
61 </div>
62 </div>
63 </div> <!-- /col-md-12 -->
64 </div> <!-- /row -->
65</div> <!-- /container -->
66<?php
67require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/quarantine.php';
68?>
69<script type='text/javascript'>
70<?php
71$lang_quarantine = json_encode($lang['quarantine']);
72echo "var acl = '". json_encode($_SESSION['acl']) . "';\n";
73echo "var lang = ". $lang_quarantine . ";\n";
74echo "var csrf_token = '". $_SESSION['CSRF']['TOKEN'] . "';\n";
75$role = ($_SESSION['mailcow_cc_role'] == "admin") ? 'admin' : 'domainadmin';
76echo "var role = '". $role . "';\n";
77echo "var pagination_size = '". $PAGINATION_SIZE . "';\n";
78?>
79</script>
80<?php
81$js_minifier->add('/web/js/site/quarantine.js');
82require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
83} else {
84 header('Location: /');
85 exit();
86}
87?>