function login_user_block_ip in Login Security 5
Same name and namespace in other branches
- 8 login_security.module \login_user_block_ip()
- 6 login_security.module \login_user_block_ip()
- 7 login_security.module \login_user_block_ip()
- 2.x login_security.module \login_user_block_ip()
Create a Deny entry for the IP address. If IP address is not especified then block current IP.
Parameters
$ip: Optional. Add a deny rule in the access control to this IP Address.
1 call to login_user_block_ip()
- login_security_validate in ./
login_security.module - Implementation of form validate. This functions does more than just validating, but it's main Intention is to break the login form flow.
File
- ./
login_security.module, line 322 - Login Security
Code
function login_user_block_ip($variables) {
db_query("INSERT INTO {access} (mask, type, status) VALUES ('%s', '%s', %d)", $variables['%ip'], 'host', 0);
watchdog('security', t('Banned IP address %ip because of login security configuration', $variables));
form_set_error('void', t(variable_get('login_security_host_hard_banned', LOGIN_SECURITY_HOST_HARD_BANNED), $variables));
}