isLoggedIn())
return;
$spamcheck = array();
switch( $data['type'] ){
case 'membermail':
$spamcheck = array (
'type' => 'membermail',
'data' => postVar('frommail')."\n".postVar('message'),
'live' => true,
'return' => true,
);
break;
case 'comment':
$spamcheck = array (
'type' => 'comment',
'body' => postVar('body'),
'author' => $data['comment']['user'],
'url' => $data['comment']['userid'],
'id' => intval($data['comment']['itemid']),
'live' => true,
'return' => true,
//SpamCheck API1 Compat
'data' => postVar('body')."\n".$data['comment']['user']."\n".$data['comment']['userid'],
);
break;
default:
return;
}
$manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck));
if (isset($spamcheck['result']) && $spamcheck['result'] == true) {
if ($manager->pluginInstalled('NP_Blacklist')) {
$plugin = & $manager->getPlugin('NP_Blacklist');
$plugin->_redirect($plugin->getOption('redirect'));
} else {
$this->_showForbiddenMessage($spamcheck['message']);
}
}
}
function _showForbiddenMessage($message = '') {
header("HTTP/1.0 403 Forbidden");
header("Status: 403 Forbidden");
echo '
'.$message.'
'; exit; } }