@@ -167,7 +167,7 @@ |
||
167 | 167 | $masked = implode('.', $tmp); |
168 | 168 | |
169 | 169 | } else { |
170 | - $masked = str_repeat('*', strlen($str) - 6) . substr(str, -6); |
|
170 | + $masked = str_repeat('*', strlen($str) - 6) . substr(str, -6); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | return $masked; |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | if ( |
58 | 58 | // Default password, unencrypted. |
59 | - $admin['user'] === $postParams['s_user'] && |
|
59 | + $admin['user'] === $postParams['s_user'] && |
|
60 | 60 | 'shieldon_pass' === $postParams['s_pass'] && |
61 | 61 | 'shieldon_pass' === $admin['pass'] |
62 | 62 | ) { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | <div class="filter-status"> |
204 | 204 | <div class="heading"><?php _e('panel', 'overview_label_action_logger', 'Action Logger'); ?></div> |
205 | 205 | <div class="nums"> |
206 | - <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
206 | + <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
207 | 207 | </div> |
208 | 208 | <div class="note"><?php _e('panel', 'overview_note_action_logger', 'Record every visitor’s behavior.'); ?></div> |
209 | 209 | </div> |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | <div class="filter-status"> |
223 | 223 | <div class="heading"><?php _e('panel', 'overview_label_recaptcha', 'reCAPTCHA'); ?></div> |
224 | 224 | <div class="nums"> |
225 | - <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
225 | + <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
226 | 226 | </div> |
227 | 227 | <div class="note"><?php _e('panel', 'overview_note_recaptcha', 'Provided by Google.'); ?></div> |
228 | 228 | </div> |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | <div class="filter-status"> |
232 | 232 | <div class="heading"><?php _e('panel', 'overview_label_image_captcha', 'Image Captcha'); ?></div> |
233 | 233 | <div class="nums"> |
234 | - <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
234 | + <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
235 | 235 | </div> |
236 | 236 | <div class="note"><?php _e('panel', 'overview_note_image_captcha', 'A simple text-in-image Captcha.'); ?></div> |
237 | 237 | </div> |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | <div class="filter-status"> |
252 | 252 | <div class="heading"><?php _e('panel', 'overview_label_' . $k, ''); ?></div> |
253 | 253 | <div class="nums"> |
254 | - <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
254 | + <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?> |
|
255 | 255 | </div> |
256 | 256 | <div class="note"><?php _e('panel', 'overview_note_' . $k, ''); ?></div> |
257 | 257 | </div> |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | * |
341 | 341 | * @return void |
342 | 342 | */ |
343 | - public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null) |
|
343 | + public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null) |
|
344 | 344 | { |
345 | 345 | // Load helper functions. This is the must. |
346 | 346 | new Helpers(); |
@@ -1648,10 +1648,10 @@ discard block |
||
1648 | 1648 | |
1649 | 1649 | $ui = [ |
1650 | 1650 | 'background_image' => $this->dialogUI['background_image'] ?? '', |
1651 | - 'bg_color' => $this->dialogUI['bg_color'] ?? '#ffffff', |
|
1652 | - 'header_bg_color' => $this->dialogUI['header_bg_color'] ?? '#212531', |
|
1653 | - 'header_color' => $this->dialogUI['header_color'] ?? '#ffffff', |
|
1654 | - 'shadow_opacity' => $this->dialogUI['shadow_opacity'] ?? '0.2', |
|
1651 | + 'bg_color' => $this->dialogUI['bg_color'] ?? '#ffffff', |
|
1652 | + 'header_bg_color' => $this->dialogUI['header_bg_color'] ?? '#212531', |
|
1653 | + 'header_color' => $this->dialogUI['header_color'] ?? '#ffffff', |
|
1654 | + 'shadow_opacity' => $this->dialogUI['shadow_opacity'] ?? '0.2', |
|
1655 | 1655 | ]; |
1656 | 1656 | |
1657 | 1657 | if (!defined('SHIELDON_VIEW')) { |
@@ -48,7 +48,7 @@ |
||
48 | 48 | * |
49 | 49 | * @return bool |
50 | 50 | */ |
51 | - public function __call($function , $args) |
|
51 | + public function __call($function, $args) |
|
52 | 52 | { |
53 | 53 | $className = 'Shieldon\Firewall\Panel\Sandbox\\' . $function; |
54 | 54 |
@@ -236,11 +236,11 @@ |
||
236 | 236 | private function overviewTemplateVarsOfComponents(array $data = []): array |
237 | 237 | { |
238 | 238 | $data['components'] = [ |
239 | - 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
239 | + 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
240 | 240 | 'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false, |
241 | - 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
242 | - 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
243 | - 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
241 | + 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
242 | + 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
243 | + 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
244 | 244 | ]; |
245 | 245 | |
246 | 246 | return $data; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $data['period_data'] = $ipDetailsCachedData['period_data']; |
128 | 128 | $lastCachedTime = date('Y-m-d H:i:s', $ipDetailsCachedData['time']); |
129 | 129 | |
130 | - if ('today' === $type ) { |
|
130 | + if ('today' === $type) { |
|
131 | 131 | $ipDetailsCachedData = $logCacheHandler->get('past_seven_hours'); |
132 | 132 | $data['past_seven_hours'] = $ipDetailsCachedData['period_data']; |
133 | 133 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $logCacheHandler->save($type, $data); |
143 | 143 | |
144 | - if ('today' === $type ) { |
|
144 | + if ('today' === $type) { |
|
145 | 145 | $this->parser->prepare('past_seven_hours'); |
146 | 146 | $data['past_seven_hours'] = $this->parser->getParsedPeriodData(); |
147 | 147 | |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | private function operationTemplateVarsOfComponents(array $data = []): array |
173 | 173 | { |
174 | 174 | $data['components'] = [ |
175 | - 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
175 | + 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
176 | 176 | 'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false, |
177 | - 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
178 | - 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
179 | - 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
177 | + 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
178 | + 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
179 | + 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
180 | 180 | ]; |
181 | 181 | |
182 | 182 | return $data; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if ( |
98 | 98 | isset($_SERVER['HTTP_HOST']) && |
99 | 99 | strpos($_SERVER['HTTP_HOST'], 'project.lo') !== false |
100 | -) { |
|
100 | +) { |
|
101 | 101 | // `shieldon-doc.lo` is the virtual domain that Terry is using to design CSS for Firewall Panel UI. |
102 | 102 | $staticSrc = 'http://shieldon-doc.lo/static'; |
103 | 103 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | </div> |
331 | 331 | </div> |
332 | 332 | </div> |
333 | - <?php if (! empty($this->messages)) : ?> |
|
333 | + <?php if (!empty($this->messages)) : ?> |
|
334 | 334 | <div id="message-modal" class="modal fade" tabindex="-1" role="dialog"> |
335 | 335 | <div class="modal-dialog modal-dialog-centered modal-lightbox" role="document"> |
336 | 336 | <div class="modal-content"> |
@@ -356,8 +356,8 @@ |
||
356 | 356 | $path = []; |
357 | 357 | |
358 | 358 | $path['filter'] = $this->directory . '/' . $this->tableFilterLogs . '/' . $ip . '.' . $this->extension; |
359 | - $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension; |
|
360 | - $path['rule'] = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension; |
|
359 | + $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension; |
|
360 | + $path['rule'] = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension; |
|
361 | 361 | |
362 | 362 | return $path[$type] ?? ''; |
363 | 363 | } |