plugins/spamx/SLVreport.Action.class.php
author Dirk Haun <dirk@haun-online.de>
Thu, 29 Oct 2009 13:00:11 +0100
branchHEAD
changeset 7397 c27e9026f22a
parent 6838 cb1ba8d99085
permissions -rw-r--r--
Fixed inclusion protection
     1 <?php
     2 
     3 /**
     4 * File: SLV.Action.class.php
     5 * This is the Spam Link Verification Action class for the Geeklog Spam-X plugin
     6 *
     7 * Copyright (C) 2006 by the following authors:
     8 * Author        Dirk Haun       dirk AT haun-online DOT de
     9 *
    10 * Licensed under the GNU General Public License
    11 *
    12 * @package Spam-X
    13 * @subpackage Modules
    14 */
    15 
    16 if (strpos(strtolower($_SERVER['PHP_SELF']), 'slvreport.action.class.php') !== false) {
    17     die('This file can not be used on its own!');
    18 }
    19 
    20 /**
    21 * Include Base Classes
    22 */
    23 require_once $_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php';
    24 require_once $_CONF['path'] . 'plugins/spamx/' . 'SLVbase.class.php';
    25 
    26 /**
    27 * Sends posts to SLV (linksleeve.org)
    28 *
    29 * Due to the way Spam-X works, the SLV Examine class may not have been
    30 * triggered when some other module detected the spam first. SLV needs to
    31 * see all links used in spam posts, though, to accurately detect spam. So
    32 * this class ensures that SLV sees spam detected by other Spam-X modules, too.
    33 *
    34 * @author Dirk Haun     dirk AT haun-online DOT de
    35 * based on the works of Tom Willet (Spam-X) and Russ Jones (SLV)
    36 * @package Spam-X
    37 *
    38 */
    39 class SLVreport extends BaseCommand {
    40     /**
    41      * Constructor
    42      * Numbers are always binary digits and added together to make call
    43      */
    44     function SLVreport()
    45     {
    46         global $num;
    47 
    48         // Actually, this is the code used by the DeleteComment class.
    49         // We're piggybacking on the delete operation here.
    50         $num = 128;
    51     }
    52 
    53     /**
    54      * Here we do the work
    55      */
    56     function execute ($comment)
    57     {
    58         global $result;
    59 
    60         $result = 128;
    61 
    62         if (isset ($GLOBALS['slv_triggered']) && $GLOBALS['slv_triggered']) {
    63             // the Examine class already reported these to SLV
    64             return 1;
    65         }
    66 
    67         $slv = new SLVbase();
    68         $slv->CheckForSpam ($comment);
    69 
    70         return 1;
    71     }
    72 }
    73 
    74 ?>