Advanced Search  :  Site Statistics  :  Directory  :  Web Resources  :  Forum  
    Plugins for Geeklog Geeklog Plugins    
 Welcome to Plugins for Geeklog
 Friday, May 09 2008 @ 10:10 PM EDT

Spam-X Ban Module

   
PluginsI created a little Spam-X action module that adds the IP of spammers to the Ban Plugin list thus blocking them from the site.

To use it just copy the code below and save it to a file called Ban.Action.class.php in your spam-x directory. Then add 256 to the Spam-x action variable.

This is aimed at those spammers who like to post hundreds of spams. The first will get caught and the rest of the attempts will result in a blank page.


<?php

/**
* File: Ban.Action.class.php
* This is the Ban Action for the Geeklog Spam-X Plug-in!
*
* Copyright (C) 2004-2005 by the following authors:
* Author Tom Willett tomw AT pigstye DOT net
*
* Licensed under GNU General Public License
*
*/

/**
* Include Abstract Action Class
*/
require_once($_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php');

/**
* Action Class which just discards comment
*
* @author Tom Willett tomw@pigstye.net
*/
class Ban extends BaseCommand {
/**
* Constructor
*/
function Ban()
{
global $num;

$num = 256;
}

function execute($comment)
{
global $reslut, $_TABLES;

$result = db_query('INSERT INTO ' . $_TABLES['ban'] . ' SET bantype="REMOTE_ADDR", data="' . $_SERVER['REMOTE_ADDR'] . '"')
$result = 256;
SPAMX_log ('IP ' . $_SERVER['REMOTE_ADDR'] . ' added to ban list');
return 0;
}
}

?>
 

Story Options

Spam-X Ban Module | 2 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Spam-X Ban Module
Authored by: anonymous on Thursday, November 03 2005 @ 05:56 PM EST
Hello,

when you say "add 256 to the Spam-x action variable.", I assume you mean to
find the following line in geeklog/plugins/spamx/config.php

// Default Spam-X Action
$_SPX_CONF['action'] = 128; // Default is ignore comment

And add 256. But I am insufficiently clueful to know what you mean by this.

Should the line read
$_SPX_CONF['action'] = 384; // Default is ignore comment
or
$_SPX_CONF['action'] = 128, 256; // Default is ignore comment

or what?

Thanks,

V.
 Copyright © 2008 Plugins for Geeklog
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.35 seconds