SET dom_status = ' . $DB->quote($dom_status) . ' WHERE dom_name =' . $DB->quote($dom_name)); echo '<a href="#" rel="' . $dom_status . '" color="' . stats_dom_status_color($dom_status) . '">' . stats_dom_status_title($dom_status) . '</a>'; break; case 'iprange_status_edit': // Update status of IP range from list screen by clicking on the status column // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('iprange'); // Check permission: $current_User->check_perm('spamblacklist', 'edit', true); $new_status = param('new_status', 'string'); $iprange_ID = param('iprange_ID', 'integer', true); $DB->query('UPDATE T_antispam__iprange SET aipr_status = ' . (empty($new_status) ? 'NULL' : $DB->quote($new_status)) . ' WHERE aipr_ID =' . $DB->quote($iprange_ID)); echo '<a href="#" rel="' . $new_status . '" color="' . aipr_status_color($new_status) . '">' . aipr_status_title($new_status) . '</a>'; break; case 'emadr_status_edit': // Update status of email address // Check that this action request is not a CSRF hacked request: $Session->assert_received_crumb('emadrstatus'); // Check permission: $current_User->check_perm('emails', 'edit', true); $new_status = param('new_status', 'string'); $emadr_ID = param('emadr_ID', 'integer', true); load_funcs('tools/model/_email.funcs.php'); $DB->query('UPDATE T_email__address SET emadr_status = ' . (empty($new_status) ? 'NULL' : $DB->quote($new_status)) . ' WHERE emadr_ID =' . $DB->quote($emadr_ID)); echo '<a href="#" rel="' . $new_status . '" color="' . emadr_get_status_color($new_status) . '">' . emadr_get_status_title($new_status) . '</a>'; break;
/** * Get status color of IP range by IP address * * @param string IP address in format xxx.xxx.xxx.xxx * @return string Status color */ function hit_iprange_status_color($IP_address) { // Get status code of IP range by IP address $ip_range_status = hit_iprange_status($IP_address); if ($ip_range_status === '') { // No IP range for this IP address return ''; } return aipr_status_color($ip_range_status); }