@@ -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 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | |
| 303 | 303 | // @codeCoverageIgnoreStart |
| 304 | 304 | |
| 305 | - } catch(Exception $e) { |
|
| 305 | + } catch (Exception $e) { |
|
| 306 | 306 | return false; |
| 307 | 307 | } |
| 308 | 308 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | // @codeCoverageIgnoreStart |
| 363 | 363 | |
| 364 | - } catch(Exception $e) { |
|
| 364 | + } catch (Exception $e) { |
|
| 365 | 365 | return false; |
| 366 | 366 | } |
| 367 | 367 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | |
| 415 | 415 | // @codeCoverageIgnoreStart |
| 416 | 416 | |
| 417 | - } catch(Exception $e) { |
|
| 417 | + } catch (Exception $e) { |
|
| 418 | 418 | return false; |
| 419 | 419 | } |
| 420 | 420 | |
@@ -100,10 +100,10 @@ |
||
| 100 | 100 | $record['session_id'] = substr($record['session_id'], 0, 4); |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $data[0] = $record['ip'] ?? 'null'; |
|
| 104 | - $data[1] = $record['session_id'] ?? 'null'; |
|
| 103 | + $data[0] = $record['ip'] ?? 'null'; |
|
| 104 | + $data[1] = $record['session_id'] ?? 'null'; |
|
| 105 | 105 | $data[2] = $record['action_code'] ?? 'null'; |
| 106 | - $data[3] = $record['timesamp'] ?? 'null'; |
|
| 106 | + $data[3] = $record['timesamp'] ?? 'null'; |
|
| 107 | 107 | |
| 108 | 108 | file_put_contents($this->filePath, implode(',', $data) . "\n", FILE_APPEND | LOCK_EX); |
| 109 | 109 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | </div> |
| 40 | 40 | <div class="board-field right"> |
| 41 | 41 | <div class="heading"><?php _e('panel', 'table_heading_period', 'Period'); ?></div> |
| 42 | - <div class="nums"><?php echo number_format($session_limit_period ); ?></div> |
|
| 42 | + <div class="nums"><?php echo number_format($session_limit_period); ?></div> |
|
| 43 | 43 | <div class="note"><?php _e('panel', 'table_note_period', 'Keep-alive period. (minutes)'); ?></div> |
| 44 | 44 | </div> |
| 45 | 45 | </div> |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | </div> |
| 50 | 50 | <div class="board-field right"> |
| 51 | 51 | <div class="heading"><?php _e('panel', 'table_heading_online', 'Online'); ?></div> |
| 52 | - <div class="nums"><?php echo number_format($online_count ); ?></div> |
|
| 52 | + <div class="nums"><?php echo number_format($online_count); ?></div> |
|
| 53 | 53 | <div class="note"><?php _e('panel', 'table_note_online', 'Online session amount.'); ?></div> |
| 54 | 54 | </div> |
| 55 | 55 | </div> |
@@ -89,14 +89,14 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $remainsTime = $expires - (time() - $sessionInfo['time']); |
| 91 | 91 | |
| 92 | - if ($remainsTime < 1 ) { |
|
| 92 | + if ($remainsTime < 1) { |
|
| 93 | 93 | $remainsTime = 0; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if ($i < $session_limit_count ) { |
|
| 96 | + if ($i < $session_limit_count) { |
|
| 97 | 97 | $satusName = __('panel', 'table_text_allowable', 'Allowable'); |
| 98 | 98 | |
| 99 | - if ($remainsTime < 1 ) { |
|
| 99 | + if ($remainsTime < 1) { |
|
| 100 | 100 | $satusName = __('panel', 'table_text_expired', 'Expired'); |
| 101 | 101 | } |
| 102 | 102 | } else { |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | ?> |
| 19 | 19 | |
| 20 | 20 | <div class="so-dashboard"> |
| 21 | - <?php if (! empty($period_data)) : ?> |
|
| 21 | + <?php if (!empty($period_data)) : ?> |
|
| 22 | 22 | <div class="so-flex"> |
| 23 | 23 | <div class="so-board"> |
| 24 | 24 | <div class="board-field left"> |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | </tr> |
| 89 | 89 | </thead> |
| 90 | 90 | <tbody> |
| 91 | - <?php if (! empty($ip_details)) : ?> |
|
| 91 | + <?php if (!empty($ip_details)) : ?> |
|
| 92 | 92 | <?php foreach ($ip_details as $ip => $ipInfo) : ?> |
| 93 | 93 | <tr> |
| 94 | 94 | <td> |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | </table> |
| 112 | 112 | </div> |
| 113 | 113 | <div class="so-timezone"> |
| 114 | - <?php if (! empty($last_cached_time)) : ?> |
|
| 114 | + <?php if (!empty($last_cached_time)) : ?> |
|
| 115 | 115 | <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong> |
| 116 | 116 | |
| 117 | 117 | <?php endif; ?> |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | <?php |
| 123 | 123 | |
| 124 | - if (! empty($period_data)) { |
|
| 124 | + if (!empty($period_data)) { |
|
| 125 | 125 | $data['period_data'] = $period_data; |
| 126 | 126 | $data['past_seven_hours'] = $past_seven_hours; |
| 127 | 127 | $this->_include('panel/js/chart', $data); |