system_block_ip_action

Versions
7
system_block_ip_action()

Implements a Drupal action: blocks the user's IP address.

Code

modules/system/system.module, line 2925

<?php
function system_block_ip_action() {
  $ip = ip_address();
  db_insert('blocked_ips')
    ->fields(array('ip' => $ip))
    ->execute();
  watchdog('action', 'Banned IP address %ip', array('%ip' => $ip));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.