blob: d5c71a0f9c3897c85ff2a7f025900841810ad547 [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'];
7
8?>
9<div class="container">
10 <div class="row">
11 <div class="col-md-12">
12 <div class="panel panel-default">
13 <div class="panel-heading">
14 <?=$lang['quarantine']['quarantine'];?> <span class="badge badge-info table-lines"></span>
15 <div class="btn-group pull-right">
16 <button class="btn btn-xs 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-default dropdown-toggle" data-toggle="dropdown"><?=$lang['quarantine']['table_size'];?>
18 <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
33 if (empty(quarantine('settings')['retention_size']) || empty(quarantine('settings')['max_size'])):
34 ?>
35 <div class="panel-body"><div class="alert alert-info"><?=$lang['quarantine']['disabled_by_config'];?></div></div>
36 <?php
37 endif;
38 ?>
39 </p>
40 <div class="table-responsive">
41 <table id="quarantinetable" class="table table-striped"></table>
42 </div>
43 <div class="mass-actions-quarantine">
44 <div class="btn-group" data-acl="<?=$_SESSION['acl']['quarantine'];?>">
45 <a class="btn btn-sm btn-default" id="toggle_multi_select_all" data-id="qitems" href="#"><span class="glyphicon glyphicon-check" aria-hidden="true"></span> <?=$lang['quarantine']['toggle_all'];?></a>
46 <a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['quarantine']['quick_actions'];?> <span class="caret"></span></a>
47 <ul class="dropdown-menu">
48 <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>
49 <li role="separator" class="divider"></li>
50 <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>
51 <li role="separator" class="divider"></li>
52 <li><a data-action="delete_selected" data-id="qitems" data-api-url='delete/qitem' href="#"><?=$lang['quarantine']['remove'];?></a></li>
53 </ul>
54 </div>
55 </div>
56 </div>
57 </div> <!-- /col-md-12 -->
58 </div> <!-- /row -->
59</div> <!-- /container -->
60<?php
61require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/quarantine.php';
62?>
63<script type='text/javascript'>
64<?php
65$lang_quarantine = json_encode($lang['quarantine']);
66echo "var acl = '". json_encode($_SESSION['acl']) . "';\n";
67echo "var lang = ". $lang_quarantine . ";\n";
68echo "var csrf_token = '". $_SESSION['CSRF']['TOKEN'] . "';\n";
69$role = ($_SESSION['mailcow_cc_role'] == "admin") ? 'admin' : 'domainadmin';
70echo "var role = '". $role . "';\n";
71echo "var pagination_size = '". $PAGINATION_SIZE . "';\n";
72?>
73</script>
74<?php
75$js_minifier->add('/web/js/site/quarantine.js');
76require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
77} else {
78 header('Location: /');
79 exit();
80}
81?>