user_block_ip_action

Versions
6
user_block_ip_action()

Implementation of a Drupal action. Adds an access rule that blocks the user's IP address.

Code

modules/user/user.module, line 2293

<?php
function user_block_ip_action() {
  $ip = ip_address();
  db_query("INSERT INTO {access} (mask, type, status) VALUES ('%s', '%s', %d)", $ip, 'host', 0);
  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.