plugins/spamx/SLV.Examine.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.Examine.class.php
     5 * This is the Spam Link Verification Examine 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']), 'slv.examine.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) for examination
    28 *
    29 * @author Dirk Haun     dirk AT haun-online DOT de
    30 * based on the works of Tom Willet (Spam-X) and Russ Jones (SLV)
    31 * @package Spam-X
    32 *
    33 */
    34 class SLV extends BaseCommand {
    35     /**
    36      * No Constructor Use BaseCommand constructor
    37      */
    38 
    39     /**
    40      * Here we do the work
    41      */
    42     function execute ($comment)
    43     {
    44         global $_USER, $LANG_SX00;
    45 
    46         $ans = 0;
    47 
    48         if (isset ($_USER['uid']) && ($_USER['uid'] > 1)) {
    49             $uid = $_USER['uid'];
    50         } else {
    51             $uid = 1;
    52         }
    53 
    54         $slv = new SLVbase();
    55         if ($slv->CheckForSpam ($comment)) {
    56             $ans = 1;
    57             SPAMX_log ($LANG_SX00['foundspam'] . 'Spam Link Verification (SLV)'.
    58                        $LANG_SX00['foundspam2'] . $uid .
    59                        $LANG_SX00['foundspam3'] . $_SERVER['REMOTE_ADDR']);
    60         }
    61 
    62         // tell the Action module that we've already been triggered
    63         $GLOBALS['slv_triggered'] = true;
    64 
    65         return $ans;
    66     }
    67 }
    68 
    69 ?>