Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 1 | <?php |
| 2 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php'; |
| 3 | |
| 4 | if (isset($_SESSION['mailcow_cc_role'])) { |
| 5 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/header.inc.php'; |
| 6 | $_SESSION['return_to'] = $_SERVER['REQUEST_URI']; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 7 | $quarantine_settings = quarantine('settings'); |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 8 | ?> |
| 9 | <div class="container"> |
| 10 | <div class="row"> |
| 11 | <div class="col-md-12"> |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 12 | <div class="panel panel-default panel-xs-lg"> |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 13 | <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 Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 16 | <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 Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 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 |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 33 | if (empty($quarantine_settings['retention_size'] || $quarantine_settings['max_size'])) { |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 34 | ?> |
| 35 | <div class="panel-body"><div class="alert alert-info"><?=$lang['quarantine']['disabled_by_config'];?></div></div> |
| 36 | <?php |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 37 | } |
| 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 Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 43 | ?> |
| 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 Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 50 | <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 Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 52 | <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 Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 59 | <div class="clearfix visible-xs"></div> |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 60 | </div> |
| 61 | </div> |
| 62 | </div> |
| 63 | </div> <!-- /col-md-12 --> |
| 64 | </div> <!-- /row --> |
| 65 | </div> <!-- /container --> |
| 66 | <?php |
| 67 | require_once $_SERVER['DOCUMENT_ROOT'] . '/modals/quarantine.php'; |
| 68 | ?> |
| 69 | <script type='text/javascript'> |
| 70 | <?php |
| 71 | $lang_quarantine = json_encode($lang['quarantine']); |
| 72 | echo "var acl = '". json_encode($_SESSION['acl']) . "';\n"; |
| 73 | echo "var lang = ". $lang_quarantine . ";\n"; |
| 74 | echo "var csrf_token = '". $_SESSION['CSRF']['TOKEN'] . "';\n"; |
| 75 | $role = ($_SESSION['mailcow_cc_role'] == "admin") ? 'admin' : 'domainadmin'; |
| 76 | echo "var role = '". $role . "';\n"; |
| 77 | echo "var pagination_size = '". $PAGINATION_SIZE . "';\n"; |
| 78 | ?> |
| 79 | </script> |
| 80 | <?php |
| 81 | $js_minifier->add('/web/js/site/quarantine.js'); |
| 82 | require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php'; |
| 83 | } else { |
| 84 | header('Location: /'); |
| 85 | exit(); |
| 86 | } |
| 87 | ?> |