You are here

function user_block_ip_action in Drupal 6

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

File

modules/user/user.module, line 2369
Enables the user registration and login system.

Code

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,
  ));
}