| 1 |
<?php defined('ABSPATH') or die("Protected By WT!");?> |
| 2 |
|
| 3 |
<div class="wtotem_container"> |
| 4 |
|
| 5 |
<a class="go-back-button" href="<?=wtsec_getUrl("waf")?>"><?= __( 'Go back', 'wtotem' ) ?></a> |
| 6 |
<div class="firewall-configuration__header-wrapper section-header-mb"> |
| 7 |
<h2 class="title"><?= __( 'Firewall configuration', 'wtotem' ) ?></h2> |
| 8 |
<div class="wtotem-waf-settings"> |
| 9 |
<button type="button" class="wtotem-waf-settings__button wtotem-waf-settings__button--active"> |
| 10 |
<span class="wtotem-waf-settings__button-text"><?= __( 'Settings', 'wtotem' ) ?></span> |
| 11 |
<svg class="wtotem-waf-settings__button-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 12 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.6015 9.05337C13.84 9.18004 14.0239 9.38004 14.1534 9.58004C14.4055 9.99337 14.385 10.5 14.1398 10.9467L13.6628 11.7467C13.4108 12.1734 12.9407 12.44 12.4569 12.44C12.2185 12.44 11.9528 12.3734 11.7347 12.24C11.5576 12.1267 11.3532 12.0867 11.1352 12.0867C10.4607 12.0867 9.89522 12.64 9.87479 13.3C9.87479 14.0667 9.24798 14.6667 8.46448 14.6667H7.53791C6.7476 14.6667 6.1208 14.0667 6.1208 13.3C6.10717 12.64 5.54169 12.0867 4.86719 12.0867C4.64236 12.0867 4.43797 12.1267 4.26765 12.24C4.04963 12.3734 3.77711 12.44 3.54546 12.44C3.05492 12.44 2.58482 12.1734 2.33274 11.7467L1.86264 10.9467C1.61056 10.5134 1.59693 9.99337 1.84901 9.58004C1.95802 9.38004 2.16241 9.18004 2.39406 9.05337C2.58482 8.96004 2.70746 8.80671 2.82328 8.62671C3.16393 8.05337 2.95954 7.30004 2.38043 6.96004C1.70594 6.58004 1.48792 5.73337 1.87627 5.07337L2.33274 4.28671C2.7279 3.62671 3.57271 3.39337 4.25402 3.78004C4.84675 4.10004 5.61663 3.88671 5.9641 3.32004C6.0731 3.13337 6.13442 2.93337 6.1208 2.73337C6.10717 2.47337 6.18211 2.22671 6.31156 2.02671C6.56364 1.61337 7.02012 1.34671 7.51747 1.33337H8.47811C8.98228 1.33337 9.43875 1.61337 9.69083 2.02671C9.81347 2.22671 9.89522 2.47337 9.87479 2.73337C9.86116 2.93337 9.92248 3.13337 10.0315 3.32004C10.379 3.88671 11.1488 4.10004 11.7484 3.78004C12.4229 3.39337 13.2745 3.62671 13.6628 4.28671L14.1193 5.07337C14.5145 5.73337 14.2965 6.58004 13.6151 6.96004C13.036 7.30004 12.8316 8.05337 13.1791 8.62671C13.2881 8.80671 13.4108 8.96004 13.6015 9.05337ZM6.0731 8.00669C6.0731 9.05336 6.93835 9.88669 8.008 9.88669C9.07765 9.88669 9.92247 9.05336 9.92247 8.00669C9.92247 6.96002 9.07765 6.12002 8.008 6.12002C6.93835 6.12002 6.0731 6.96002 6.0731 8.00669Z" fill="#3D50DF" /> |
| 13 |
</svg> |
| 14 |
</button> |
| 15 |
<div class="wtotem-waf-settings__popup"> |
| 16 |
|
| 17 |
<div class="wt-spinner d-none wt-waf-settings-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div> |
| 18 |
<section class="wtotem-waf-settings-popup"> |
| 19 |
<h2 class="wtotem-waf-settings-popup__title"><?= __( 'Settings', 'wtotem' ) ?> |
| 20 |
<div class="wtotem_title-info__info wtotem-tooltip"> |
| 21 |
<div class="wtotem-tooltip__content"> |
| 22 |
<p class="wtotem-tooltip__header"><?= __( 'Settings', 'wtotem' ) ?></p> |
| 23 |
<p class="wtotem-tooltip__text"><?= __( 'Sets firewall custom rules.', 'wtotem' ) ?></p> |
| 24 |
</div> |
| 25 |
</div> |
| 26 |
</h2> |
| 27 |
|
| 28 |
<a class="wtotem-waf-settings-popup__configuration-link button" href="<?=wtsec_getUrl("waf-config")?>"> |
| 29 |
<?= __( 'Advanced options', 'wtotem' ) ?> |
| 30 |
</a> |
| 31 |
<form action="#" class="wtotem-waf-settings-popup__form" method="post" id="wtotem-waf-settings-form"> |
| 32 |
<input type="hidden" name="action" value="waf_settings"> |
| 33 |
<div class="wtotem_firewall-section-menu-item"> |
| 34 |
<div class="wt-flex wt-flex-middle"><strong>GDN</strong><div> |
| 35 |
<div class="wtotem_title-info__info wtotem-tooltip"> |
| 36 |
<div class="wtotem-tooltip__content"> |
| 37 |
<p class="wtotem-tooltip__header">GDN</p> |
| 38 |
<p class="wtotem-tooltip__text"><?= __( 'This option protects you from hackers detected on other websites connected to our global defence network.', 'wtotem' ) ?></p> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
<div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text"> |
| 43 |
<input type="checkbox" class="onoff__input waf_settings_toggle" name="gdn" id="gdn" |
| 44 |
<?= ($arguments['settings']['gdn'])? 'checked' : '' ?> /> |
| 45 |
<label for="gdn" class="onoff__label"> |
| 46 |
<span class="onoff__circle"></span> |
| 47 |
</label> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
|
| 51 |
<div class="wtotem_firewall-section-menu-item"> |
| 52 |
<div class="wt-flex wt-flex-middle"><strong><?= __( 'DoS limits', 'wtotem' ) ?></strong><div> |
| 53 |
<div class="wtotem_title-info__info wtotem-tooltip"> |
| 54 |
<div class="wtotem-tooltip__content"> |
| 55 |
<p class="wtotem-tooltip__header"><?= __( 'DoS limits', 'wtotem' ) ?></p> |
| 56 |
<p class="wtotem-tooltip__text"><?= __( 'Limits the number of requests per minute from an IP address.', 'wtotem' ) ?></p> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
<div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text"> |
| 61 |
<input type="checkbox" class="onoff__input waf_settings_toggle" |
| 62 |
id="wtotem-dos" name="dosProtection" |
| 63 |
<?= ($arguments['settings']['dosProtection'])? 'checked' : '' ?> /> |
| 64 |
<label for="wtotem-dos" class="onoff__label"> |
| 65 |
<span class="onoff__circle"></span> |
| 66 |
</label> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
</div> |
| 70 |
|
| 71 |
<div class="wtotem_firewall-section-menu-item"> |
| 72 |
<div class="wt-flex wt-flex-middle"><strong><?= __( 'Login attempts', 'wtotem' ) ?></strong><div> |
| 73 |
<div class="wtotem_title-info__info wtotem-tooltip"> |
| 74 |
<div class="wtotem-tooltip__content"> |
| 75 |
<p class="wtotem-tooltip__header"><?= __( 'Login attempts', 'wtotem' ) ?></p> |
| 76 |
<p class="wtotem-tooltip__text"><?= __( 'Limits the number of login attempts per minute.', 'wtotem' ) ?></p> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
</div> |
| 80 |
<div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text"> |
| 81 |
<input type="checkbox" class="onoff__input waf_settings_toggle" |
| 82 |
id="wtotem-login-attempts" name="loginAttemptsProtection" |
| 83 |
<?= ($arguments['settings']['loginAttemptsProtection'])? 'checked' : '' ?> /> |
| 84 |
<label for="wtotem-login-attempts" class="onoff__label"> |
| 85 |
<span class="onoff__circle"></span> |
| 86 |
</label> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
|
| 91 |
<div id="wtotem-dos-limit" class="<?= (!$arguments['settings']['dosProtection'])? 'visually-hidden' : '' ?>"> |
| 92 |
<label class="wtotem-waf-settings-popup__label" for="waf-limit"><?= __( 'DoS limits (requests per minute)', 'wtotem' ) ?></label> |
| 93 |
<input class="wtotem-waf-settings-popup__input" |
| 94 |
type="number" min="0" placeholder="Type limit" id="waf-limit" name="dosLimit" |
| 95 |
<?= (!$arguments['settings']['dosProtection'])? 'disabled="disabled"' : '' ?> |
| 96 |
value="<?= $arguments['settings']['dosLimit'] ?: 20000 ?>" |
| 97 |
required> |
| 98 |
</div> |
| 99 |
|
| 100 |
<div id="wtotem-login-attempts-limit" class="<?= (!$arguments['settings']['loginAttemptsProtection'])? 'visually-hidden' : '' ?>"> |
| 101 |
<label class="wtotem-waf-settings-popup__label" for="waf-login-attempts"><?= __( 'Login attempts', 'wtotem' ) ?></label> |
| 102 |
<input class="wtotem-waf-settings-popup__input" |
| 103 |
type="number" min="0" placeholder="Type limit" id="waf-login-attempts" name="loginAttemptsLimit" |
| 104 |
<?= (!$arguments['settings']['loginAttemptsProtection'])? 'disabled="disabled"' : '' ?> |
| 105 |
value="<?= $arguments['settings']['loginAttemptsLimit'] ?: 20 ?>" |
| 106 |
required> |
| 107 |
</div> |
| 108 |
<button class="wtotem-waf-settings-popup__save button" type="submit"><?= __( 'Save settings', 'wtotem' ) ?></button> |
| 109 |
</form> |
| 110 |
</section> |
| 111 |
</div> |
| 112 |
</div> |
| 113 |
</div> |
| 114 |
|
| 115 |
<section class="wt_card"> |
| 116 |
|
| 117 |
<div class="wtotem-tabs firewall-configuration"> |
| 118 |
<div class="wt-spinner d-none wt-waf-config-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div> |
| 119 |
<ul class="wtotem-tabs__caption firewall-configuration__list-types"> |
| 120 |
<li class="firewall-configuration__list-types-item active"><?= __( 'Allow list', 'wtotem' ) ?></li> |
| 121 |
<li class="firewall-configuration__list-types-item"><?= __( 'Deny list', 'wtotem' ) ?></li> |
| 122 |
<li class="firewall-configuration__list-types-item"><?= __( 'URL Allow list', 'wtotem' ) ?></li> |
| 123 |
</ul> |
| 124 |
|
| 125 |
<div class="wtotem-tabs__content active"> |
| 126 |
<form method="POST" class="wtotem-firewall-configuration-form"> |
| 127 |
<div class="firewall-configuration__ip-adress-wrapper"> |
| 128 |
<label class="visually-hidden" for="wt-ip-adredss"><?= __( 'IP Address', 'wtotem' ) ?></label> |
| 129 |
<input type="hidden" name="list" value="white"> |
| 130 |
<input type="hidden" name="action" value="waf_add_ip_to_list"> |
| 131 |
<input class="firewall-configuration__ip-adress" name="ip" type="text" autocomplete="off" placeholder="<?= __( 'Type IPv4 or IPv6 address or a mask (104.122.249.38 or 104.122.*.*)', 'wtotem' ) ?>"> |
| 132 |
<button class="firewall-configuration__add button" type="submit"><?= __( 'Add IP', 'wtotem' ) ?></button> |
| 133 |
<button class="firewall-configuration__multi-adding" data-list="white" type="button"><?= __( 'Multi-adding IP', 'wtotem' ) ?></button> |
| 134 |
</div> |
| 135 |
</form> |
| 136 |
<div class="wtotem-box wtotem-box-white"> |
| 137 |
<?php if(!empty($arguments['whiteList'])): ?> |
| 138 |
<table class="firewall-configuration__ip-list firewall-ip-table"> |
| 139 |
<thead> |
| 140 |
<tr> |
| 141 |
<th class="firewall-ip-table__th"><?= __( 'IP Address', 'wtotem' ) ?></th> |
| 142 |
<th class="firewall-ip-table__th"><?= __( 'Date added', 'wtotem' ) ?></th> |
| 143 |
<th class="firewall-ip-table__th"><?= __( 'Actions', 'wtotem' ) ?></th> |
| 144 |
</tr> |
| 145 |
</thead> |
| 146 |
<tbody> |
| 147 |
<?php foreach ($arguments['whiteList'] as $argument):?> |
| 148 |
<tr class="firewall-ip-table__tr"> |
| 149 |
<td class="firewall-ip-table__td"><?= $argument['ip']?></td> |
| 150 |
<td class="firewall-ip-table__td"><?= convertTimeToReadable($argument['createdAt'])?></td> |
| 151 |
<td class="firewall-ip-table__td"> |
| 152 |
<button class="firewall-ip-table__remove wtotem-ip-remove" |
| 153 |
type="button" data-id="<?= $argument['id']?>" data-list="whiteList"><?= __( 'Remove', 'wtotem' ) ?></button> |
| 154 |
</td> |
| 155 |
</tr> |
| 156 |
<?php endforeach; ?> |
| 157 |
</tbody> |
| 158 |
</table> |
| 159 |
<?php else:?> |
| 160 |
<div class="wtotem-firewall-settings__no-data"> |
| 161 |
<div class="wtotem-firewall-settings__no-data-icon"> |
| 162 |
<img src="<?= wtsec_getImagePath("list.svg") ?>"> |
| 163 |
</div> |
| 164 |
<div> |
| 165 |
<?= __( 'No IP address here', 'wtotem' ) ?> |
| 166 |
</div> |
| 167 |
</div> |
| 168 |
<?php endif;?> |
| 169 |
</div> |
| 170 |
</div> |
| 171 |
|
| 172 |
<div class="wtotem-tabs__content"> |
| 173 |
<form method="POST" class="wtotem-firewall-configuration-form"> |
| 174 |
<div class="firewall-configuration__ip-adress-wrapper"> |
| 175 |
<label class="visually-hidden" for="wt-ip-adredss"><?= __( 'IP Address', 'wtotem' ) ?></label> |
| 176 |
<input type="hidden" name="list" value="black"> |
| 177 |
<input type="hidden" name="action" value="waf_add_ip_to_list"> |
| 178 |
<input class="firewall-configuration__ip-adress" name="ip" type="text" autocomplete="off" placeholder="<?= __( 'Type IPv4 or IPv6 address or a mask (104.122.249.38 or 104.122.*.*)', 'wtotem' ) ?>"> |
| 179 |
<button class="firewall-configuration__add button" type="submit"><?= __( 'Add IP', 'wtotem' ) ?></button> |
| 180 |
<button class="firewall-configuration__multi-adding multi-adding-deny_list" data-list="black" type="button"><?= __( 'Multi-adding IP', 'wtotem' ) ?></button> |
| 181 |
</div> |
| 182 |
</form> |
| 183 |
|
| 184 |
<div class="wtotem-box wtotem-box-black"> |
| 185 |
<?php if(!empty($arguments['blackList'])): ?> |
| 186 |
<table class="firewall-configuration__ip-list firewall-ip-table"> |
| 187 |
<thead> |
| 188 |
<tr> |
| 189 |
<th class="firewall-ip-table__th"><?= __( 'IP Address', 'wtotem' ) ?></th> |
| 190 |
<th class="firewall-ip-table__th"><?= __( 'Date added', 'wtotem' ) ?></th> |
| 191 |
<th class="firewall-ip-table__th"><?= __( 'Actions', 'wtotem' ) ?></th> |
| 192 |
</tr> |
| 193 |
</thead> |
| 194 |
<tbody> |
| 195 |
<?php foreach ($arguments['blackList'] as $argument):?> |
| 196 |
<tr class="firewall-ip-table__tr"> |
| 197 |
<td class="firewall-ip-table__td"><?= $argument['ip']?></td> |
| 198 |
<td class="firewall-ip-table__td"><?= convertTimeToReadable($argument['createdAt'])?></td> |
| 199 |
<td class="firewall-ip-table__td"> |
| 200 |
<button class="firewall-ip-table__remove wtotem-ip-remove" |
| 201 |
type="button" data-id="<?= $argument['id']?>" data-list="blackList"><?= __( 'Remove', 'wtotem' ) ?></button> |
| 202 |
</td> |
| 203 |
</tr> |
| 204 |
<?php endforeach; ?> |
| 205 |
</tbody> |
| 206 |
</table> |
| 207 |
<?php else:?> |
| 208 |
<div class="wtotem-firewall-settings__no-data"> |
| 209 |
<div class="wtotem-firewall-settings__no-data-icon"> |
| 210 |
<img src="<?= wtsec_getImagePath("list.svg") ?>"> |
| 211 |
</div> |
| 212 |
<div> |
| 213 |
<?= __( 'No IP address here', 'wtotem' ) ?> |
| 214 |
</div> |
| 215 |
</div> |
| 216 |
<?php endif;?> |
| 217 |
</div> |
| 218 |
</div> |
| 219 |
|
| 220 |
<div class="wtotem-tabs__content"> |
| 221 |
<form method="POST" class="wtotem-url-list-form"> |
| 222 |
<div class="firewall-configuration__ip-adress-wrapper"> |
| 223 |
<input type="hidden" name="action" value="add_url_to_list"> |
| 224 |
<input class="firewall-configuration__ip-adress" name="url" type="text" autocomplete="off" placeholder="/path"> |
| 225 |
<button class="firewall-configuration__add button" type="submit"><?= __( 'Add URL', 'wtotem' ) ?></button> |
| 226 |
</div> |
| 227 |
</form> |
| 228 |
|
| 229 |
<div class="wtotem-box-url"> |
| 230 |
<?php include 'components/_url_list.php'?> |
| 231 |
</div> |
| 232 |
</div> |
| 233 |
</div><!-- .tabs--> |
| 234 |
</section> |
| 235 |
</div> |
| 236 |
|
| 237 |
<!-- Firewall multi-add popup --> |
| 238 |
<div class="firewall-multi-adding side-modal"> |
| 239 |
<section class="side-modal__content wt_card"> |
| 240 |
<div class="wt-spinner d-none wt-multi-adding-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div> |
| 241 |
<div class="side-modal__header-wrapper"> |
| 242 |
<h2 class="side-modal__title"><?= __( 'Multi-adding IP', 'wtotem' ) ?></h2> |
| 243 |
<button class="firewall-multi-adding__close side-modal__close"> |
| 244 |
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 245 |
<path d="M12 0C5.38338 0 0 5.38292 0 12C0 18.6171 5.38338 24 12 24C18.6166 24 24 18.6171 24 12C24 5.38292 18.6166 0 12 0ZM12 23.0769C5.89246 23.0769 0.923077 18.1075 0.923077 12C0.923077 5.89246 5.89246 0.923077 12 0.923077C18.1075 0.923077 23.0769 5.89246 23.0769 12C23.0769 18.1075 18.1075 23.0769 12 23.0769Z" fill="#5E6977" /> |
| 246 |
<path d="M16.4803 7.51987C16.2998 7.33941 16.0081 7.33941 15.8277 7.51987L12.0001 11.3474L8.17261 7.51987C7.99214 7.33941 7.70045 7.33941 7.51999 7.51987C7.33953 7.70033 7.33953 7.99202 7.51999 8.17248L11.3475 12L7.51999 15.8276C7.33953 16.008 7.33953 16.2997 7.51999 16.4802C7.60999 16.5702 7.72814 16.6154 7.8463 16.6154C7.96445 16.6154 8.08261 16.5702 8.17261 16.4802L12.0001 12.6526L15.8277 16.4802C15.9177 16.5702 16.0358 16.6154 16.154 16.6154C16.2721 16.6154 16.3903 16.5702 16.4803 16.4802C16.6608 16.2997 16.6608 16.008 16.4803 15.8276L12.6528 12L16.4803 8.17248C16.6608 7.99202 16.6608 7.70033 16.4803 7.51987Z" fill="#5E6977" /> |
| 247 |
</svg> |
| 248 |
<span class="visually-hidden"><?= __( 'close', 'wtotem' ) ?></span> |
| 249 |
</button> |
| 250 |
</div> |
| 251 |
|
| 252 |
<form class="firewall-multi-adding__form"> |
| 253 |
<input type="hidden" name="list" id="wtotem-ip-list-type" value=""> |
| 254 |
<input type="hidden" name="action" value="waf_add_ip_to_list"> |
| 255 |
<div class="firewall-multi-adding__label-wrapper"> |
| 256 |
<label class="firewall-multi-adding__label" for="ip-list"> |
| 257 |
<?= __( 'IP lists configuration', 'wtotem' ) ?>  |
| 258 |
</label> |
| 259 |
<span class="wtotem_title-info__info wtotem-tooltip firewall-multi-adding__tooltip"> |
| 260 |
<div class="wtotem-tooltip__content wtotem-tooltip__content--top-center firewall-multi-adding__tooltip-content"> |
| 261 |
<p class="wtotem-tooltip__header firewall-multi-adding__tooltip-header"><?= __( 'How to use?', 'wtotem' ) ?></p> |
| 262 |
<p class="wtotem-tooltip__text"><?= __( 'If you want to add several IP addresses at once, you can add the |
| 263 |
address separated by commas.', 'wtotem' ) ?> |
| 264 |
</p> |
| 265 |
</div> |
| 266 |
</span> |
| 267 |
</div> |
| 268 |
<textarea rows=10 class="firewall-multi-adding__input" placeholder='<?= __( 'Example:', 'wtotem' ) ?> 104.122.249.38, 104.122.249.39' id="ip-list" name="ip"></textarea> |
| 269 |
<p class="firewall-multi-adding__info"></p> |
| 270 |
<button class="firewall-multi-adding__save button"> |
| 271 |
<?= __( 'Save settings', 'wtotem' ) ?> |
| 272 |
</button> |
| 273 |
</form> |
| 274 |
</section> |
| 275 |
<div class="side-modal__overlay"></div> |
| 276 |
</div> |