function kpg_ss_log_akismet() { sfs_errorsonoff(); $options = kpg_ss_get_options(); $stats = kpg_ss_get_stats(); if ($options['chkakismet'] != 'Y') { return false; } // check white lists first $reason = kpg_ss_check_white(); if ($reason !== false) { return; } // not on allow lists $post = get_post_variables(); $post['reason'] = 'from Akismet'; $post['chk'] = 'chkakismet'; $ansa = be_load('kpg_ss_log_bad', kpg_get_ip(), $stats, $options, $post); sfs_errorsonoff('off'); return $ansa; }
function kpg_ss_user_reg_filter($user_login) { // the plugin should be all initialized // check the ip, etc. sfs_errorsonoff(); $options = kpg_ss_get_options(); $stats = kpg_ss_get_stats(); // fake out the post variables $post = get_post_variables(); $post['author'] = $user_login; $post['addon'] = 'chkRegister'; // no really an addon - but may be moved out when working. if ($options['filterregistrations'] != 'Y') { remove_filter('pre_user_login', kpg_ss_user_reg_filter, 1); sfs_errorsonoff('off'); return $user_login; } // if the suspect is already in the bad cache he does not get a second chance? // prevents looping $reason = be_load('chkbcache', kpg_get_ip(), $stats, $options, $post); sfs_errorsonoff(); if ($reason !== false) { $rejectmessage = $options['rejectmessage']; $post['reason'] = 'Failed Registration: bad cache'; $host['chk'] = 'chkbcache'; $ansa = be_load('kpg_ss_log_bad', kpg_get_ip(), $stats, $options, $post); wp_die("{$rejectmessage}", "Login Access Denied", array('response' => 403)); exit; } // check the white list $reason = kpg_ss_check_white(); sfs_errorsonoff(); if ($reason !== false) { $post['reason'] = 'passed registration:' . $reason; $ansa = be_load('kpg_ss_log_good', kpg_get_ip(), $stats, $options, $post); sfs_errorsonoff('off'); return $user_login; } // check the black list //sfs_debug_msg("Checking black list on registration: /r/n".print_r($post,true)); $ret = be_load('kpg_ss_check_post', kpg_get_ip(), $stats, $options, $post); $post['reason'] = 'Passed Registration ' . $ret; $ansa = be_load('kpg_ss_log_good', kpg_get_ip(), $stats, $options, $post); return $user_login; }