function rules_action_block_ip

Action: Block an IP address.

Related topics

1 string reference to 'rules_action_block_ip'
rules_system_action_info in modules/system.rules.inc
Implements hook_rules_action_info() on behalf of the system module.

File

modules/system.eval.inc, line 170

Code

function rules_action_block_ip($ip_address = NULL) {
    if (empty($ip_address)) {
        $ip_address = ip_address();
    }
    db_insert('blocked_ips')->fields(array(
        'ip' => $ip_address,
    ))
        ->execute();
    watchdog('rules', 'Banned IP address %ip', array(
        '%ip' => $ip_address,
    ));
}