You are here

function hook_restrict_by_ip_get_ip_alter in Restrict Login or Role Access by IP Address 7.3

Alter the IP address of the user.

In some cases it may desirable to use alternative methods to determine the users IP address. This will alter the IP address that is compared with the configured IP whitelists.

Warning: Using this hook has security implications. Providing a wrong IP address could allow users to bypass IP restrictions.

Parameters

$ip_address: IP address of user.

1 invocation of hook_restrict_by_ip_get_ip_alter()
_restrict_by_ip_get_ip in ./restrict_by_ip.module
Returns the IP address of the user, taking into account header configuration.

File

./restrict_by_ip.api.php, line 21
Documentation of restrict_by_ip hooks.

Code

function hook_restrict_by_ip_get_ip_alter(&$ip_address) {

  // Use drupal core ip_address() instead.
  $ip_address = ip_address();
}