/[drupal]/contributions/modules/troll/troll.module
ViewVC logotype

Diff of /contributions/modules/troll/troll.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.32.2.8, Mon May 4 19:06:09 2009 UTC revision 1.32.2.9, Sat May 9 03:56:10 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: troll.module,v 1.32.2.7 2009/04/24 18:31:08 deekayen Exp $  // $Id: troll.module,v 1.32.2.8 2009/05/04 19:06:09 deekayen Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 478  function troll_block_user($uid) { Line 478  function troll_block_user($uid) {
478  /**  /**
479   * Implementation of hook_comment().   * Implementation of hook_comment().
480   */   */
481  function troll_dnsbl_comment($comment, $op) {  function troll_comment($comment, $op) {
482    if (variable_get('troll_dnsbl_active', 0) != 1) {    if (variable_get('troll_dnsbl_active', 0) != 1) {
483      return;      return;
484    }    }
# Line 492  function troll_dnsbl_comment($comment, $ Line 492  function troll_dnsbl_comment($comment, $
492        $blacklisted = _troll_dnsbl_blacklisted($ip);        $blacklisted = _troll_dnsbl_blacklisted($ip);
493    
494        if ($blacklisted == TRUE) {        if ($blacklisted == TRUE) {
         // Unpublish and enform the user.  
495          $operation = comment_operations('unpublish');          $operation = comment_operations('unpublish');
496          $query = $operation['unpublish'][1];          $query = $operation['unpublish'][1];
497          db_query($query, $comment->cid);          db_query($query, $comment->cid);
498          drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));          drupal_set_message(t('Your comment has been queued for moderation by site administrators and will be published after approval.'));
499          // log          watchdog('troll', 'Comment unpublished for DNSBL: %subject.', array('%subject' => $comment->subject), WATCHDOG_INFO, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
         watchdog('troll', 'Comment: unpublished %subject.', array('%subject' => $comment->subject), WATCHDOG_INFO, l(t('view'), 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid));  
500        }        }
501        else {        else {
502          watchdog('troll', 'IP %ip is not blacklisted.', array('%ip' => $ip), WATCHDOG_INFO, l(t('view'), 'node/'. $comment->nid, NULL, NULL, 'comment-'. $comment->cid));          watchdog('troll', 'IP %ip is not blacklisted.', array('%ip' => $ip), WATCHDOG_INFO, l(t('view'), 'node/'. $comment->nid, array('fragment' => 'comment-'. $comment->cid)));
503        }        }
504        return;        return;
505      default:      default:

Legend:
Removed from v.1.32.2.8  
changed lines
  Added in v.1.32.2.9

  ViewVC Help
Powered by ViewVC 1.1.2