@@ -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> |
@@ -62,7 +62,8 @@ discard block |
||
| 62 | 62 | </tbdoy> |
| 63 | 63 | </table> |
| 64 | 64 | </div> |
| 65 | - <?php else: ?> |
|
| 65 | + <?php else { |
|
| 66 | + : ?> |
|
| 66 | 67 | <div id="so-table-loading" class="so-datatables"> |
| 67 | 68 | <div class="lds-css ng-scope"> |
| 68 | 69 | <div class="lds-ripple"> |
@@ -71,7 +72,9 @@ discard block |
||
| 71 | 72 | </div> |
| 72 | 73 | </div> |
| 73 | 74 | </div> |
| 74 | - <?php endif; ?> |
|
| 75 | + <?php endif; |
|
| 76 | +} |
|
| 77 | +?> |
|
| 75 | 78 | <div id="so-table-container" class="so-datatables" style="display: none;"> |
| 76 | 79 | <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%"> |
| 77 | 80 | <thead> |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | </div> |
| 115 | 115 | </div> |
| 116 | 116 | <br /> |
| 117 | - <?php if ( empty($xss_protected_list)) : ?> |
|
| 117 | + <?php if (empty($xss_protected_list)) : ?> |
|
| 118 | 118 | <div id="so-table-container" class="so-datatables"> |
| 119 | 119 | <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%"> |
| 120 | 120 | <tbody> |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | </tr> |
| 147 | 147 | </thead> |
| 148 | 148 | <tbody> |
| 149 | - <?php if (! empty($xss_protected_list)) : ?> |
|
| 149 | + <?php if (!empty($xss_protected_list)) : ?> |
|
| 150 | 150 | <?php foreach ($xss_protected_list as $i => $info) : ?> |
| 151 | 151 | <tr> |
| 152 | 152 | <td><?php echo $info['type']; ?></td> |
@@ -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 /> |
@@ -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 { |
@@ -58,20 +58,20 @@ |
||
| 58 | 58 | </thead> |
| 59 | 59 | <tbody> |
| 60 | 60 | <?php foreach ($ip_log_list as $ipInfo) : ?> |
| 61 | - <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true ); ?> |
|
| 61 | + <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true); ?> |
|
| 62 | 62 | <?php |
| 63 | 63 | |
| 64 | 64 | $text_warning = ''; |
| 65 | 65 | |
| 66 | - if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100 ) { |
|
| 66 | + if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100) { |
|
| 67 | 67 | $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2 ) { |
|
| 70 | + if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2) { |
|
| 71 | 71 | $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>'; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3 ) { |
|
| 74 | + if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3) { |
|
| 75 | 75 | $text_warning = '<span class="so-text-danger"><i class="fas fa-exclamation-triangle"></i></span>'; |
| 76 | 76 | } |
| 77 | 77 | ?> |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public static function get(array $setting): MessengerInterface |
| 31 | 31 | { |
| 32 | 32 | $botToken = $setting['config']['bot_token'] ?? ''; |
| 33 | - $channel = $setting['config']['channel'] ?? ''; |
|
| 33 | + $channel = $setting['config']['channel'] ?? ''; |
|
| 34 | 34 | |
| 35 | 35 | return new Slack($botToken, $channel); |
| 36 | 36 | } |