[geeklog-cvs] geeklog-1.3/plugins/spamx BaseAdmin.class.php,1.1,1.2 BaseCommand.class.php,1.1,1.2 BlackList.Examine.class.php,1.2,1.3
blaine at iowaoutdoors.org
blaine at iowaoutdoors.org
Sun Oct 3 14:39:33 EDT 2004
Update of /var/cvs/geeklog-1.3/plugins/spamx
In directory www:/tmp/cvs-serv14810/plugins/spamx
Modified Files:
BaseAdmin.class.php BaseCommand.class.php
BlackList.Examine.class.php
Log Message:
Added call to new PLG_checkforSpam API
Index: BaseCommand.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/BaseCommand.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BaseCommand.class.php 3 Sep 2004 19:59:55 -0000 1.1
--- BaseCommand.class.php 3 Oct 2004 18:39:31 -0000 1.2
***************
*** 2,53 ****
/**
! * Basic Command Abstract class
! *
! * @author Tom Willett tomw AT pigstye DOT net
! *
! */
class BaseCommand {
! /**
! * @access public
! */
!
! var $comment; //Comment array
!
! var $result = null; //Result of execute command
!
! /**
! * Constructor
! *
! * @access public
! *
! */
! function BaseCommand()
! {
! global $comment;
!
! $comment = array();
! }
!
! function execute()
! {
! return 0;
! }
!
! function init($comm) {
! global $comment;
!
! $comment = $comm;
! }
- function getComment() {
- global $comment;
- return $comment;
- }
- function result()
- {
- global $result;
-
- return $result;
- }
- }
?>
\ No newline at end of file
--- 2,44 ----
/**
! * Basic Command Abstract class
! *
! * @author Tom Willett tomw AT pigstye DOT net
! */
class BaseCommand {
! /**
! *
! * @access public
! */
!
! var $result = null; //Result of execute command
! var $num = 0; // Action Number
! /**
! * Constructor
! *
! * @access public
! */
! function BaseCommand()
! {
! }
!
! function execute($comment)
! {
! return 0;
! }
!
! function result()
! {
! global $result;
!
! return $result;
! }
! function number()
! {
! global $num;
!
! return $num;
! }
! }
?>
\ No newline at end of file
Index: BlackList.Examine.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/BlackList.Examine.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BlackList.Examine.class.php 2 Oct 2004 13:35:23 -0000 1.2
--- BlackList.Examine.class.php 3 Oct 2004 18:39:31 -0000 1.3
***************
*** 1,62 ****
<?php
/**
! * File: BlackList.Examine.class.php
! * This is the Personal BlackList Examine class for the Geeklog SpamX Plug-in!
! *
! * Copyright (C) 2004 by the following authors:
! *
! * @ Author Tom Willett tomw at pigstye.net
! *
! * Licensed under GNU General Public License
! *
! */
/**
! *Include Abstract Examine Class
! *
! */
require_once($_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php');
-
/**
! * Examines Comment according to Personal BLacklist
! *
! * @author Tom Willett tomw AT pigstye DOT net
! *
! */
class BlackList extends BaseCommand {
! /**
! * No Constructor Use BaseCommand constructor
! *
! */
! /**
! * Here we do the work
! *
! */
! function execute()
! {
! global $_CONF, $result, $comment, $_USER, $_TABLES, $LANG_SX00, $HTTP_SERVER_VARS;
!
! /**
! * Include Blacklist Data
! *
! */
! $result=DB_query("SELECT * FROM {$_TABLES['spamx']} WHERE name='Personal'",1);
! $nrows=DB_numRows($result);
! $ans = 0;
! for($i=1;$i<=$nrows;$i++) {
! $A=DB_fetchArray($result);
! $val=$A['value'];
! if (preg_match("#$val#",$comment['comment'])) {
! $ans=1; // quit on first positive match
! SPAMX_log($LANG_SX00['foundspam'] . $val .$LANG_SX00['foundspam2'] . $_USER['uid'] . $LANG_SX00['foundspam3'] . $HTTP_SERVER_VARS['REMOTE_ADDR']);
! break;
! }
! }
! return $ans;
! }
! }
! ?>
--- 1,54 ----
<?php
/**
! * File: BlackList.Examine.class.php
! * This is the Personal BlackList Examine class for the Geeklog SpamX Plug-in!
! *
! * Copyright (C) 2004 by the following authors:
! * Author Tom Willett tomw at pigstye.net
! *
! * Licensed under GNU General Public License
! */
/**
! * Include Abstract Examine Class
! */
require_once($_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php');
/**
! * Examines Comment according to Personal BLacklist
! *
! * @author Tom Willett tomw AT pigstye DOT net
! */
class BlackList extends BaseCommand {
! /**
! * No Constructor Use BaseCommand constructor
! */
! /**
! * Here we do the work
! */
! function execute($comment)
! {
! global $_CONF, $result, $_USER, $_TABLES, $REMOTE_ADDR, $LANG_SX00;
! /**
! * Include Blacklist Data
! */
! $result = DB_query("SELECT * FROM {$_TABLES['spamx']} WHERE name='Personal'", 1);
! $nrows = DB_numRows($result);
! $ans = 0;
! for($i = 1;$i <= $nrows;$i++) {
! $A = DB_fetchArray($result);
! $val = $A['value'];
! if (preg_match("#$val#", $comment)) {
! $ans = 1; // quit on first positive match
! SPAMX_log($LANG_SX00['foundspam'] . $val . $LANG_SX00['foundspam2'] . $_USER['uid'] . $LANG_SX00['foundspam3'] . $REMOTE_ADDR);
! break;
! }
! }
! return $ans;
! }
! }
!
! ?>
\ No newline at end of file
Index: BaseAdmin.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/BaseAdmin.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BaseAdmin.class.php 3 Sep 2004 19:59:55 -0000 1.1
--- BaseAdmin.class.php 3 Oct 2004 18:39:31 -0000 1.2
***************
*** 2,34 ****
/**
! * Abstract class for Admin Duties for Spam comments
! *
! * @author Tom Willett tomw AT pigstye DOT net
! *
! */
class BaseAdmin {
! /**
! * @access private
! */
!
! /**
! * Constructor
! *
! * @access public
! *
! */
! function BaseAdmin()
! {
! }
!
! function display()
! {
! return '';
! }
!
! function link()
! {
! return '';
! }
! }
?>
\ No newline at end of file
--- 2,34 ----
/**
! * Abstract class for Admin Duties for Spam comments
! *
! * @author Tom Willett tomw AT pigstye DOT net
! */
class BaseAdmin {
! /**
! *
! * @access private
! */
!
! /**
! * Constructor
! *
! * @access public
! */
! function BaseAdmin()
! {
! }
!
! function display()
! {
! return '';
! }
!
! function link()
! {
! return '';
! }
! }
!
?>
\ No newline at end of file
More information about the geeklog-cvs
mailing list