You are here

function _ip_login_get_user_range in IP Login 6.2

Same name and namespace in other branches
  1. 7.2 ip_login.module \_ip_login_get_user_range()

Gets a user's IP range match string by uid

Parameters

$uid: The user ID

Return value

The IP range string for the user if one is found, otherwise NULL.

2 calls to _ip_login_get_user_range()
ip_login_user in ./ip_login.module
Implementation of hook_user().
_ip_login_set_user_range in ./ip_login.module
Sets the IP range match string for a user.

File

./ip_login.module, line 596
Allow user login by IP addresses, ranges or wildcards.

Code

function _ip_login_get_user_range($uid) {
  if (isset($uid) && is_numeric($uid)) {
    if ($result = db_fetch_object(db_query("SELECT * FROM {ip_login_user} WHERE uid = %d", $uid))) {
      return $result->ip_match;
    }
  }
  return NULL;
}