You are here

function ip_login_user_update in IP Login 7.2

Same name and namespace in other branches
  1. 4.x ip_login.module \ip_login_user_update()

Implements hook_user_update().

File

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

Code

function ip_login_user_update(&$edit, $account, $category) {

  // Only update if ip_login_match field returned to avoid issue with Remember Me
  // (and others using hook_user update) wiping the field. By PeterX
  // http://drupal.org/node/1482934
  if (!isset($edit['ip_login_match'])) {
    return;
  }

  // all ok, save the data.
  _ip_login_set_user_range($account->uid, isset($edit['ip_login_match']) ? trim(check_plain($edit['ip_login_match'])) : NULL);
}