function cerber_is_allowed($ip = '') { global $wpdb; if (!$ip) { $ip = cerber_get_ip(); } if (cerber_is_citadel()) { if (cerber_get_options('ciwhite') && cerber_acl_check($ip, 'W')) { return true; } return false; } $tag = cerber_acl_check($ip); if ($tag == 'W') { return true; } if ($tag == 'B') { return false; } if (cerber_block_check($ip)) { return false; } return true; }
function cerber_admin_notice() { if (cerber_is_citadel() && current_user_can('manage_options')) { echo '<div class="update-nag crb-alarm"><p>' . __('Attention! Citadel mode is now active. Nobody is able to login.', 'cerber') . ' <a href="' . wp_nonce_url(add_query_arg(array('citadel' => 'deactivate')), 'control', 'cerber_nonce') . '">' . __('Deactivate', 'cerber') . '</a>' . ' | <a href="' . admin_url(cerber_get_opage() . '&tab=activity') . '">' . __('View Activity', 'cerber') . '</a>' . '</p></div>'; } if (!cerber_is_my_page()) { return; } cerber_update_check(); if ($notices = get_site_option('cerber_admin_notice')) { echo '<div class="update-nag crb-note"><p>' . $notices . '</p></div>'; } // class="updated" - green, class="update-nag" - yellow and above the page title, if ($notices = get_site_option('cerber_admin_message')) { echo '<div class="updated crb-msg"><p>' . $notices . '</p></div>'; } // class="updated" - green, class="update-nag" - yellow and above the page title, update_site_option('cerber_admin_notice', ''); update_site_option('cerber_admin_message', ''); }