@@ -171,11 +171,11 @@ |
||
171 | 171 | */ |
172 | 172 | |
173 | 173 | $data['components'] = [ |
174 | - 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
174 | + 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
175 | 175 | 'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false, |
176 | - 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
177 | - 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
178 | - 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
176 | + 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
177 | + 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
178 | + 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
179 | 179 | ]; |
180 | 180 | |
181 | 181 | $reflection = new ReflectionObject($this->kernel); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | define('SHIELDON_VIEW', true); |
175 | 175 | } |
176 | 176 | |
177 | - $viewFilePath = __DIR__ . '/../../../templates/' . $page . '.php'; |
|
177 | + $viewFilePath = __DIR__ . '/../../../templates/' . $page . '.php'; |
|
178 | 178 | |
179 | 179 | if (!empty($data)) { |
180 | 180 | extract($data); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } else { |
366 | 366 | if (is_numeric($postData)) { |
367 | 367 | $this->setConfig(str_replace('__', '.', $postKey), (int) $postData); |
368 | - } else { |
|
368 | + } else { |
|
369 | 369 | $this->setConfig(str_replace('__', '.', $postKey), $postData); |
370 | 370 | } |
371 | 371 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | (string) $db['user'], |
396 | 396 | (string) $db['pass'] |
397 | 397 | ); |
398 | - } catch(PDOException $e) { |
|
398 | + } catch (PDOException $e) { |
|
399 | 399 | $isDataDriverFailed = true; |
400 | 400 | $this->pushMessage('error', |
401 | 401 | __( |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | if (class_exists('PDO')) { |
441 | 441 | try { |
442 | 442 | $pdo = new PDO('sqlite:' . $sqliteFilePath); |
443 | - } catch(PDOException $e) { |
|
443 | + } catch (PDOException $e) { |
|
444 | 444 | $isDataDriverFailed = true; |
445 | 445 | $this->pushMessage('error', $e->getMessage()); |
446 | 446 | } |
@@ -475,9 +475,9 @@ discard block |
||
475 | 475 | $redis = new Redis(); |
476 | 476 | $redis->connect( |
477 | 477 | (string) $this->getConfig('drivers.redis.host'), |
478 | - (int) $this->getConfig('drivers.redis.port') |
|
478 | + (int) $this->getConfig('drivers.redis.port') |
|
479 | 479 | ); |
480 | - } catch(RedisException $e) { |
|
480 | + } catch (RedisException $e) { |
|
481 | 481 | $isDataDriverFailed = true; |
482 | 482 | $this->pushMessage('error', $e->getMessage()); |
483 | 483 | } |
@@ -573,10 +573,10 @@ discard block |
||
573 | 573 | // Create default log files. |
574 | 574 | if (is_writable($iptablesWatchingFolder)) { |
575 | 575 | fopen($iptablesWatchingFolder . '/iptables_queue.log', 'w+'); |
576 | - fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
577 | - fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
578 | - fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
579 | - fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
576 | + fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
577 | + fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
578 | + fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
579 | + fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
580 | 580 | } |
581 | 581 | } |
582 | 582 |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | public function operation(): ResponseInterface |
43 | 43 | { |
44 | 44 | $data['components'] = [ |
45 | - 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
45 | + 'Ip' => (!empty($this->kernel->component['Ip'])) ? true : false, |
|
46 | 46 | 'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false, |
47 | - 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
48 | - 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
49 | - 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
47 | + 'Header' => (!empty($this->kernel->component['Header'])) ? true : false, |
|
48 | + 'Rdns' => (!empty($this->kernel->component['Rdns'])) ? true : false, |
|
49 | + 'UserAgent' => (!empty($this->kernel->component['UserAgent'])) ? true : false, |
|
50 | 50 | ]; |
51 | 51 | |
52 | 52 | $reflection = new ReflectionObject($this->kernel); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $data['period_data'] = $ipDetailsCachedData['period_data']; |
219 | 219 | $lastCachedTime = date('Y-m-d H:i:s', $ipDetailsCachedData['time']); |
220 | 220 | |
221 | - if ('today' === $type ) { |
|
221 | + if ('today' === $type) { |
|
222 | 222 | $ipDetailsCachedData = $logCacheHandler->get('past_seven_hours'); |
223 | 223 | $data['past_seven_hours'] = $ipDetailsCachedData['period_data']; |
224 | 224 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | $logCacheHandler->save($type, $data); |
234 | 234 | |
235 | - if ('today' === $type ) { |
|
235 | + if ('today' === $type) { |
|
236 | 236 | $this->parser->prepare('past_seven_hours'); |
237 | 237 | $data['past_seven_hours'] = $this->parser->getParsedPeriodData(); |
238 | 238 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <div class="so-dashboard"> |
17 | - <?php if (! empty($period_data)) : ?> |
|
17 | + <?php if (!empty($period_data)) : ?> |
|
18 | 18 | <div class="so-flex"> |
19 | 19 | <div class="so-board"> |
20 | 20 | <div class="board-field left"> |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | </tr> |
86 | 86 | </thead> |
87 | 87 | <tbody> |
88 | - <?php if (! empty($ip_details)) : ?> |
|
89 | - <?php foreach($ip_details as $ip => $ipInfo) : ?> |
|
88 | + <?php if (!empty($ip_details)) : ?> |
|
89 | + <?php foreach ($ip_details as $ip => $ipInfo) : ?> |
|
90 | 90 | <tr> |
91 | 91 | <td> |
92 | 92 | <?php if ($this->mode === 'demo') : ?> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | </table> |
109 | 109 | </div> |
110 | 110 | <div class="so-timezone"> |
111 | - <?php if (! empty($last_cached_time)) : ?> |
|
111 | + <?php if (!empty($last_cached_time)) : ?> |
|
112 | 112 | <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong> |
113 | 113 | |
114 | 114 | <?php endif; ?> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | <?php |
120 | 120 | |
121 | - if (! empty($period_data)) { |
|
121 | + if (!empty($period_data)) { |
|
122 | 122 | $data['period_data'] = $period_data; |
123 | 123 | $this->_include('panel/js/chart', $data); |
124 | 124 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <div class="so-dashboard"> |
17 | - <?php if (! empty($period_data)) : ?> |
|
17 | + <?php if (!empty($period_data)) : ?> |
|
18 | 18 | <div class="so-flex"> |
19 | 19 | <div class="so-board"> |
20 | 20 | <div class="board-field left"> |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | </tr> |
86 | 86 | </thead> |
87 | 87 | <tbody> |
88 | - <?php if (! empty($ip_details)) : ?> |
|
89 | - <?php foreach($ip_details as $ip => $ipInfo) : ?> |
|
88 | + <?php if (!empty($ip_details)) : ?> |
|
89 | + <?php foreach ($ip_details as $ip => $ipInfo) : ?> |
|
90 | 90 | <tr> |
91 | 91 | <td> |
92 | 92 | <?php if ($this->mode === 'demo') : ?> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | </table> |
109 | 109 | </div> |
110 | 110 | <div class="so-timezone"> |
111 | - <?php if (! empty($last_cached_time)) : ?> |
|
111 | + <?php if (!empty($last_cached_time)) : ?> |
|
112 | 112 | <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong> |
113 | 113 | |
114 | 114 | <?php endif; ?> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | <?php |
120 | 120 | |
121 | - if (! empty($period_data)) { |
|
121 | + if (!empty($period_data)) { |
|
122 | 122 | $data['period_data'] = $period_data; |
123 | 123 | $this->_include('panel/js/chart', $data); |
124 | 124 | } |
@@ -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 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | </div> |
332 | 332 | </div> |
333 | 333 | |
334 | - <?php if (! empty($this->messages)) : ?> |
|
334 | + <?php if (!empty($this->messages)) : ?> |
|
335 | 335 | <div id="message-modal" class="modal fade" tabindex="-1" role="dialog"> |
336 | 336 | <div class="modal-dialog modal-dialog-centered modal-lightbox" role="document"> |
337 | 337 | <div class="modal-content"> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | ?> |
15 | 15 | |
16 | 16 | <div class="so-dashboard"> |
17 | - <?php if (! empty($period_data)) : ?> |
|
17 | + <?php if (!empty($period_data)) : ?> |
|
18 | 18 | <div class="so-flex"> |
19 | 19 | <div class="so-board"> |
20 | 20 | <div class="board-field left"> |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | </tr> |
86 | 86 | </thead> |
87 | 87 | <tbody> |
88 | - <?php if (! empty($ip_details)) : ?> |
|
89 | - <?php foreach($ip_details as $ip => $ipInfo) : ?> |
|
88 | + <?php if (!empty($ip_details)) : ?> |
|
89 | + <?php foreach ($ip_details as $ip => $ipInfo) : ?> |
|
90 | 90 | <tr> |
91 | 91 | <td> |
92 | 92 | <?php if ($this->mode === 'demo') : ?> |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | </table> |
109 | 109 | </div> |
110 | 110 | <div class="so-timezone"> |
111 | - <?php if (! empty($last_cached_time)) : ?> |
|
111 | + <?php if (!empty($last_cached_time)) : ?> |
|
112 | 112 | <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong> |
113 | 113 | |
114 | 114 | <?php endif; ?> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | <?php |
120 | 120 | |
121 | - if (! empty($period_data)) { |
|
121 | + if (!empty($period_data)) { |
|
122 | 122 | $data['period_data'] = $period_data; |
123 | 123 | $this->_include('panel/js/chart', $data); |
124 | 124 | } |
@@ -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')) { |