You are here

restrict_by_ip.api.php in Restrict Login or Role Access by IP Address 7.3

Documentation of restrict_by_ip hooks.

File

restrict_by_ip.api.php
View source
<?php

/**
 * @file
 * Documentation of restrict_by_ip hooks.
 */

/**
 * 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.
 *
 * @param $ip_address
 *   IP address of user.
 */
function hook_restrict_by_ip_get_ip_alter(&$ip_address) {

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

Functions

Namesort descending Description
hook_restrict_by_ip_get_ip_alter Alter the IP address of the user.