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 title of IP range by IP address * * @param string IP address in format xxx.xxx.xxx.xxx * @return string Status title */ function hit_iprange_status_title($IP_address) { global $current_User, $admin_url; // 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 if ($current_User->check_perm('spamblacklist', 'edit')) { // Display a link to create new one if user has an access return '<a href="' . $admin_url . '?ctrl=antispam&tab3=ipranges&action=iprange_new&ip=' . $IP_address . '">' . T_('Create') . '</a>'; } else { // No access to create new IP range return ''; } } if ($current_User->check_perm('spamblacklist', 'view')) { // Current user has access to view IP ranges global $blog; $blog_param = empty($blog) ? '' : '&blog=1'; return '<a href="' . $admin_url . '?ctrl=antispam&tab=stats&tab3=ipranges&ip_address=' . $IP_address . $blog_param . '">' . aipr_status_title($ip_range_status) . '</a>'; } else { // No view access, Display only the status return aipr_status_title($ip_range_status); } }
/** * Get array of status icons for email address * * @return array Status icons */ function aipr_status_icons() { return array('' => get_icon('bullet_white', 'imgtag', array('title' => aipr_status_title(''))), 'trusted' => get_icon('bullet_green', 'imgtag', array('title' => aipr_status_title('trusted'))), 'suspect' => get_icon('bullet_orange', 'imgtag', array('title' => aipr_status_title('suspect'))), 'blocked' => get_icon('bullet_red', 'imgtag', array('title' => aipr_status_title('blocked')))); }
var result = value.match(re); return { '' : '<?php echo aipr_status_title(''); ?> ', 'trusted' : '<?php echo aipr_status_title('trusted'); ?> ', 'suspect' : '<?php echo aipr_status_title('suspect'); ?> ', 'blocked' : '<?php echo aipr_status_title('blocked'); ?> ', 'selected' : result[1] } }, type : 'select', name : 'new_status', tooltip : 'Click to edit', event : 'click', callback : function( settings, original ) { //evoFadeSuccess( this ); jQuery( this ).html( ajax_debug_clear( settings ) ); var link = jQuery( this ).find( 'a' ); jQuery( this ).css( 'background-color', link.attr( 'color' ) );
// IP range exists in DB $iprange_status = $IPRange->get('status'); $iprange_name = $IPRange->get_name(); } else { // There is no IP range in DB $iprange_status = ''; $iprange_name = ''; } $Form->info_field(T_('IP range'), $iprange_name); $email_status_icon = '<div id="iprange_status_icon" class="status_icon">' . aipr_status_icon($iprange_status) . '</div>'; if ($current_User->check_perm('spamblacklist', 'edit')) { // User can edit IP ranges $Form->select_input_array('edited_iprange_status', $iprange_status, aipr_status_titles(true), T_('IP range status'), '', array('force_keys_as_values' => true, 'background_color' => aipr_status_colors(), 'field_suffix' => $email_status_icon)); } else { // Only view status of IP range $Form->info(T_('IP range status'), $email_status_icon . aipr_status_title($iprange_status)); } } $Form->info_field(T_('From Country'), $from_country, array('field_suffix' => $user_from_country_suffix)); $user_domain = $UserSettings->get('user_domain', $edited_User->ID); $Form->info_field(T_('From Domain'), format_to_output($user_domain)); if (!empty($user_domain) && $current_User->check_perm('stats', 'list')) { // User can view Domains // Get status of Domain $DomainCache =& get_DomainCache(); $Domain =& $DomainCache->get_by_name($user_domain, false, false); $domain_status = $Domain ? $Domain->get('status') : 'unknown'; $domain_status_icon = '<div id="domain_status_icon" class="status_icon">' . stats_dom_status_icon($domain_status) . '</div>'; if ($current_User->check_perm('stats', 'edit')) { // User can edit Domain $Form->select_input_array('edited_domain_status', $domain_status, stats_dom_status_titles(), T_('Domain status'), '', array('force_keys_as_values' => true, 'background_color' => stats_dom_status_colors(), 'field_suffix' => $domain_status_icon));