Skip to content

Commit

Permalink
Fix. FireWall. Statuses of the triggered networks displayed. (#275)
Browse files Browse the repository at this point in the history
* Fix. FireWall. Statuses of the triggered networks displayed.

* Fix. Code. Code style fixed.
  • Loading branch information
Glomberg authored Dec 1, 2023
1 parent 72d8e13 commit 51b6dfb
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions inc/spbc-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2125,21 +2125,27 @@ function spbc_field_traffic_control_logs__prepare_data(&$table)
. '<div class="spbcFullText spbc_hide">' . $row->http_user_agent . '</div>'
: $row->http_user_agent;

$is_personal_text = $row->is_personal
? esc_html__('by personal lists.', 'security-malware-firewall')
: esc_html__('by common lists.', 'security-malware-firewall');
$passed_text = esc_html__('Passed', 'security-malware-firewall') . ' ' . $is_personal_text;
$blocked_text = esc_html__('Blocked', 'security-malware-firewall') . ' ' . $is_personal_text;

switch ($row->status) {
case 'PASS':
$status = '<span class="spbcGreen">' . __('Passed', 'security-malware-firewall') . '</span>';
$status = '<span class="spbcGreen">' . $passed_text . '</span>';
break;
case 'PASS_BY_TRUSTED_NETWORK':
$status = '<span class="spbcGreen">' . __('Passed. Trusted network. Click on IP for details.', 'security-malware-firewall') . '</span>';
$status = '<span class="spbcGreen">' . $passed_text . ' ' . __('Trusted network. Click on IP for details.', 'security-malware-firewall') . '</span>';
break;
case 'PASS_BY_WHITELIST':
$status = '<span class="spbcGreen">' . __('Passed. Whitelisted.', 'security-malware-firewall') . '</span>';
$status = '<span class="spbcGreen">' . $passed_text . ' ' . __('Whitelisted.', 'security-malware-firewall') . '</span>';
break;
case 'DENY':
$status = '<span class="spbcRed">' . __('Blocked. Blacklisted.', 'security-malware-firewall') . '</span>';
$status = '<span class="spbcRed">' . $blocked_text . ' ' . __('Blacklisted.', 'security-malware-firewall') . '</span>';
break;
case 'DENY_BY_NETWORK':
$status = '<span class="spbcRed">' . __('Blocked. Hazardous network. Common source.', 'security-malware-firewall') . '</span>';
$status = '<span class="spbcRed">' . $blocked_text . ' ' . __('Hazardous network.', 'security-malware-firewall') . '</span>';
break;
case 'DENY_BY_DOS':
$status = '<span class="spbcRed">' . __('Blocked by Traffic control', 'security-malware-firewall') . '</span>';
Expand Down Expand Up @@ -3304,7 +3310,7 @@ function spbc_list_table__get_args_by_type($table_type)
'id' => 'spbc_tbl__traffic_control_logs',
'sql' => array(
'except_cols' => array('country', 'entries', 'requests_per'),
'add_col' => array('entry_id', 'pattern'),
'add_col' => array('entry_id', 'pattern', 'is_personal'),
'table' => SPBC_TBL_FIREWALL_LOG,
'offset' => 0,
'limit' => SPBC_LAST_ACTIONS_TO_VIEW,
Expand Down

0 comments on commit 51b6dfb

Please sign in to comment.