PluginProbe
WebTotem Security / 2.3.24
WebTotem Security v2.3.24
3.0.2 3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 All 110 releases
wt-security / includes / firewall_configuration.php

firewall_configuration.php in WebTotem Security 2.3.24, at includes/firewall_configuration.php

214 lines 15.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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")?>"><?= wtsec_locale("back") ?></a>
6 <div class="firewall-configuration__header-wrapper section-header-mb">
7 <h2 class="title"><?= wtsec_locale("firewall_configuration") ?></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"><?= wtsec_locale("settings") ?></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"><?= wtsec_locale("settings") ?>
20 <div class="wtotem_title-info__info wtotem-tooltip">
21 <div class="wtotem-tooltip__content">
22 <?= wtsec_locale("tooltips.waf_settings") ?>
23 </div>
24 </div>
25 </h2>
26
27 <form action="#" class="wtotem-waf-settings-popup__form" method="post" id="wtotem-waf-settings-form">
28
29 <input type="hidden" name="action" value="waf_settings">
30 <div class="wtotem_firewall-section-menu-item">
31 <div class="wt-flex wt-flex-middle"><strong>GDN</strong><div>
32 <div class="wtotem_title-info__info wtotem-tooltip">
33 <div class="wtotem-tooltip__content">
34 <p class="wtotem-tooltip__header">GDN</p>
35 <?= wtsec_locale("tooltips.gdn") ?>
36 </div>
37 </div>
38 </div>
39 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
40 <input type="checkbox" class="onoff__input waf_settings_toggle" name="gdn" id="gdn"
41 <?= ($arguments['settings']['gdn'])? 'checked' : '' ?> />
42 <label for="gdn" class="onoff__label">
43 <span class="onoff__circle"></span>
44 </label>
45 </div>
46 </div>
47
48 <div class="wtotem_firewall-section-menu-item">
49 <div class="wt-flex wt-flex-middle"><strong><?= wtsec_locale("dos_limit") ?></strong><div>
50 <div class="wtotem_title-info__info wtotem-tooltip">
51 <div class="wtotem-tooltip__content">
52 <p class="wtotem-tooltip__header"><?= wtsec_locale("dos_limit") ?></p>
53 <?= wtsec_locale("tooltips.dos") ?>
54 </div>
55 </div>
56 </div>
57 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
58 <input type="checkbox" class="onoff__input waf_settings_toggle"
59 id="wtotem-dos" name="dosProtection"
60 <?= ($arguments['settings']['dosProtection'])? 'checked' : '' ?> />
61 <label for="wtotem-dos" class="onoff__label">
62 <span class="onoff__circle"></span>
63 </label>
64 </div>
65 </div>
66 </div>
67
68 <div class="wtotem_firewall-section-menu-item">
69 <div class="wt-flex wt-flex-middle"><strong><?= wtsec_locale("login_attempts") ?></strong><div>
70 <div class="wtotem_title-info__info wtotem-tooltip">
71 <div class="wtotem-tooltip__content">
72 <?= wtsec_locale("tooltips.login_attempts") ?>
73 </div>
74 </div>
75 </div>
76 <div class="wtotem_option__checkbox onoff wtotem_switch-checkbox-with-text">
77 <input type="checkbox" class="onoff__input waf_settings_toggle"
78 id="wtotem-login-attempts" name="loginAttemptsProtection"
79 <?= ($arguments['settings']['loginAttemptsProtection'])? 'checked' : '' ?> />
80 <label for="wtotem-login-attempts" class="onoff__label">
81 <span class="onoff__circle"></span>
82 </label>
83 </div>
84 </div>
85 </div>
86
87 <div id="wtotem-dos-limit" class="<?= (!$arguments['settings']['dosProtection'])? 'visually-hidden' : '' ?>">
88 <label class="wtotem-waf-settings-popup__label" for="waf-limit"><?= wtsec_locale("dos_limit_requests") ?></label>
89 <input class="wtotem-waf-settings-popup__input"
90 type="number" min="0" placeholder="Type limit" id="waf-limit" name="dosLimit"
91 <?= (!$arguments['settings']['dosProtection'])? 'disabled="disabled"' : '' ?>
92 value="<?= $arguments['settings']['dosLimit'] ?: 20000 ?>"
93 required>
94 </div>
95
96 <div id="wtotem-login-attempts-limit" class="<?= (!$arguments['settings']['loginAttemptsProtection'])? 'visually-hidden' : '' ?>">
97 <label class="wtotem-waf-settings-popup__label" for="waf-login-attempts"><?= wtsec_locale("login_attempts") ?></label>
98 <input class="wtotem-waf-settings-popup__input"
99 type="number" min="0" placeholder="Type limit" id="waf-login-attempts" name="loginAttemptsLimit"
100 <?= (!$arguments['settings']['loginAttemptsProtection'])? 'disabled="disabled"' : '' ?>
101 value="<?= $arguments['settings']['loginAttemptsLimit'] ?: 20 ?>"
102 required>
103 </div>
104 <button class="wtotem-waf-settings-popup__save button" type="submit"><?= wtsec_locale("save_settings") ?></button>
105 </form>
106 </section>
107 </div>
108 </div>
109 </div>
110
111 <section class="wt_card">
112
113 <div class="wtotem-tabs firewall-configuration">
114 <div class="wt-spinner d-none wt-waf-config-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div>
115 <ul class="wtotem-tabs__caption firewall-configuration__list-types">
116 <li class="firewall-configuration__list-types-item active">Whitelist</li>
117 <li class="firewall-configuration__list-types-item">Blacklist</li>
118 </ul>
119
120 <div class="wtotem-tabs__content active">
121 <form method="POST" class="wtotem-firewall-configuration-form">
122 <div class="firewall-configuration__ip-adress-wrapper">
123 <label class="visually-hidden" for="wt-ip-adredss"><?= wtsec_locale("ip_address") ?></label>
124 <input type="hidden" name="list" value="white">
125 <input type="hidden" name="action" value="waf_add_ip_to_list">
126 <input class="firewall-configuration__ip-adress" name="ip" type="text" placeholder="<?= wtsec_locale("ip_placeholder") ?>">
127 <button class="firewall-configuration__add button" type="submit"><?= wtsec_locale("add_ip") ?></button>
128 </div>
129 </form>
130 <div class="wtotem-box">
131 <?php if(!empty($arguments['whiteList'])): ?>
132 <table class="firewall-configuration__ip-list firewall-ip-table">
133 <thead>
134 <tr>
135 <th class="firewall-ip-table__th"><?= wtsec_locale("ip_address") ?></th>
136 <th class="firewall-ip-table__th"><?= wtsec_locale("date_added") ?></th>
137 <th class="firewall-ip-table__th"><?= wtsec_locale("actions") ?></th>
138 </tr>
139 </thead>
140 <tbody>
141 <?php foreach ($arguments['whiteList'] as $argument):?>
142 <tr class="firewall-ip-table__tr">
143 <td class="firewall-ip-table__td"><?= $argument['ip']?></td>
144 <td class="firewall-ip-table__td"><?= convertTimeToReadable($argument['createdAt'])?></td>
145 <td class="firewall-ip-table__td">
146 <button class="firewall-ip-table__remove wtotem-ip-remove"
147 type="button" data-id="<?= $argument['id']?>" data-list="whiteList"><?= wtsec_locale("remove") ?></button>
148 </td>
149 </tr>
150 <?php endforeach; ?>
151 </tbody>
152 </table>
153 <?php else:?>
154 <div class="wtotem-firewall-settings__no-data">
155 <div class="wtotem-firewall-settings__no-data-icon">
156 <img src="<?= wtsec_getImagePath("list.svg") ?>">
157 </div>
158 <div>
159 <?= wtsec_locale("no_ip_address_here") ?>
160 </div>
161 </div>
162 <?php endif;?>
163 </div>
164 </div>
165
166 <div class="wtotem-tabs__content">
167 <form method="POST" class="wtotem-firewall-configuration-form">
168 <div class="firewall-configuration__ip-adress-wrapper">
169 <label class="visually-hidden" for="wt-ip-adredss"><?= wtsec_locale("ip_address") ?></label>
170 <input type="hidden" name="list" value="black">
171 <input type="hidden" name="action" value="waf_add_ip_to_list">
172 <input class="firewall-configuration__ip-adress" name="ip" type="text" placeholder="<?= wtsec_locale("ip_placeholder") ?>">
173 <button class="firewall-configuration__add button" type="submit"><?= wtsec_locale("add_ip") ?></button>
174 </div>
175 </form>
176
177 <div class="wtotem-box">
178 <?php if(!empty($arguments['blackList'])): ?>
179 <table class="firewall-configuration__ip-list firewall-ip-table">
180 <thead>
181 <tr>
182 <th class="firewall-ip-table__th"><?= wtsec_locale("ip_address") ?></th>
183 <th class="firewall-ip-table__th"><?= wtsec_locale("date_added") ?></th>
184 <th class="firewall-ip-table__th"><?= wtsec_locale("actions") ?></th>
185 </tr>
186 </thead>
187 <tbody>
188 <?php foreach ($arguments['blackList'] as $argument):?>
189 <tr class="firewall-ip-table__tr">
190 <td class="firewall-ip-table__td"><?= $argument['ip']?></td>
191 <td class="firewall-ip-table__td"><?= convertTimeToReadable($argument['createdAt'])?></td>
192 <td class="firewall-ip-table__td">
193 <button class="firewall-ip-table__remove wtotem-ip-remove"
194 type="button" data-id="<?= $argument['id']?>" data-list="blackList"><?= wtsec_locale("remove") ?></button>
195 </td>
196 </tr>
197 <?php endforeach; ?>
198 </tbody>
199 </table>
200 <?php else:?>
201 <div class="wtotem-firewall-settings__no-data">
202 <div class="wtotem-firewall-settings__no-data-icon">
203 <img src="<?= wtsec_getImagePath("list.svg") ?>">
204 </div>
205 <div>
206 <?= wtsec_locale("no_ip_address_here") ?>
207 </div>
208 </div>
209 <?php endif;?>
210 </div>
211 </div>
212 </div><!-- .tabs-->
213 </section>
214 </div>