/[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.1, Wed Feb 11 18:52:15 2009 UTC revision 1.32.2.2, Sun Mar 1 03:26:44 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: troll.module,v 1.32 2009/02/11 18:16:09 deekayen Exp $  // $Id: troll.module,v 1.32.2.1 2009/02/11 18:52:15 deekayen Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 72  function troll_boot() { Line 72  function troll_boot() {
72      $ban = db_fetch_object(db_query('SELECT * FROM {troll_ip_ban} WHERE (expires > %d OR expires = 0) AND ip_address = \'%s\'', time(), ip_address()));      $ban = db_fetch_object(db_query('SELECT * FROM {troll_ip_ban} WHERE (expires > %d OR expires = 0) AND ip_address = \'%s\'', time(), ip_address()));
73      if (!empty($ban->ip_address)) {      if (!empty($ban->ip_address)) {
74        global $base_url;        global $base_url;
75        watchdog('troll', 'IP Ban: '. ip_address(), array(), WATCHDOG_NOTICE);        watchdog('troll', 'IP Ban: !addr', array('!addr' => ip_address()), WATCHDOG_NOTICE);
76        $troll_ip_ban_redirect = variable_get('troll_ip_ban_redirect', '');        $troll_ip_ban_redirect = variable_get('troll_ip_ban_redirect', '');
77        if (empty($troll_ip_ban_redirect)) {        if (empty($troll_ip_ban_redirect)) {
78          include_once('includes/common.inc');          include_once('includes/common.inc');
# Line 94  function troll_help($path, $arg) { Line 94  function troll_help($path, $arg) {
94    switch ($path) {    switch ($path) {
95      case 'admin/settings/troll/ip_ban':      case 'admin/settings/troll/ip_ban':
96        if (!variable_get('troll_enable_ip_ban', 1)) {        if (!variable_get('troll_enable_ip_ban', 1)) {
97          return "<div class='messages error'>". t('IP banning is currently disabled. You can enable it in the !settings page.', array('!settings' => l(t('settings'), 'admin/settings/troll/settings')));          return '<div class="messages error">'. t('IP banning is currently disabled. You can enable it in the !settings page.', array('!settings' => l(t('settings'), 'admin/settings/troll/settings')));
98        }        }
99        break;        break;
100    }    }
# Line 347  function troll_update_ip($edit) { Line 347  function troll_update_ip($edit) {
347      drupal_set_message(t('IP ban updated: %ip', array('%ip' => $edit['ip_address'])));      drupal_set_message(t('IP ban updated: %ip', array('%ip' => $edit['ip_address'])));
348    }    }
349    else {    else {
350      drupal_set_message(t('An error occurred, IP ban not updated.'));      drupal_set_message(t('An error occurred. IP ban not updated.'));
351    }    }
352  }  }
353    

Legend:
Removed from v.1.32.2.1  
changed lines
  Added in v.1.32.2.2

  ViewVC Help
Powered by ViewVC 1.1.2