@@ -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; |
@@ -304,9 +304,12 @@ |
||
304 | 304 | <div> |
305 | 305 | <?php if ($this->mode === 'demo') : ?> |
306 | 306 | <code id="code1" style="display: none">* * * * * root bash your_project_folder/vendor/shieldon/bin/iptables_bridge.sh --watch=your_watching_folder >> /var/log/shieldon.log 2>&1</code> |
307 | - <?php else: ?> |
|
307 | + <?php else { |
|
308 | + : ?> |
|
308 | 309 | <code id="code1" style="display: none">* * * * * root bash <?php echo realpath(__DIR__ . '/../../../bin/iptables_bridge.sh') ?> --watch=<span id="iptables-watch-folder"></span> >> /var/log/shieldon.log 2>&1</code> |
309 | - <?php endif; ?> |
|
310 | + <?php endif; |
|
311 | +} |
|
312 | +?> |
|
310 | 313 | |
311 | 314 | <textarea id="code2" class="form-control" rows="4" style="font-size: 12px; font-family: monospace;"></textarea> |
312 | 315 | </div><br /> |
@@ -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); |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | } else { |
526 | 526 | if (is_numeric($postData)) { |
527 | 527 | $this->setConfig(str_replace('__', '.', $postKey), (int) $postData); |
528 | - } else { |
|
528 | + } else { |
|
529 | 529 | $this->setConfig(str_replace('__', '.', $postKey), $postData); |
530 | 530 | } |
531 | 531 | } |
@@ -613,10 +613,10 @@ discard block |
||
613 | 613 | // Create default log files. |
614 | 614 | if (is_writable($iptablesWatchingFolder)) { |
615 | 615 | fopen($iptablesWatchingFolder . '/iptables_queue.log', 'w+'); |
616 | - fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
617 | - fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
618 | - fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
619 | - fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
616 | + fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+'); |
|
617 | + fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+'); |
|
618 | + fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+'); |
|
619 | + fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+'); |
|
620 | 620 | } |
621 | 621 | } |
622 | 622 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | (string) $db['user'], |
695 | 695 | (string) $db['pass'] |
696 | 696 | ); |
697 | - } catch(PDOException $e) { |
|
697 | + } catch (PDOException $e) { |
|
698 | 698 | $result = false; |
699 | 699 | $this->pushMessage('error', |
700 | 700 | __( |
@@ -747,7 +747,7 @@ discard block |
||
747 | 747 | if (class_exists('PDO')) { |
748 | 748 | try { |
749 | 749 | new PDO('sqlite:' . $sqliteFilePath); |
750 | - } catch(PDOException $e) { |
|
750 | + } catch (PDOException $e) { |
|
751 | 751 | $this->pushMessage('error', $e->getMessage()); |
752 | 752 | $result = false; |
753 | 753 | } |
@@ -789,10 +789,10 @@ discard block |
||
789 | 789 | $redis = new Redis(); |
790 | 790 | $redis->connect( |
791 | 791 | (string) $this->getConfig('drivers.redis.host'), |
792 | - (int) $this->getConfig('drivers.redis.port') |
|
792 | + (int) $this->getConfig('drivers.redis.port') |
|
793 | 793 | ); |
794 | 794 | unset($redis); |
795 | - } catch(RedisException $e) { |
|
795 | + } catch (RedisException $e) { |
|
796 | 796 | $this->pushMessage('error', $e->getMessage()); |
797 | 797 | $result = false; |
798 | 798 | } |