You are here

function ip_login_attempt_login in IP Login 7.2

Same name and namespace in other branches
  1. 6.2 ip_login.module \ip_login_attempt_login()
  2. 7.3 ip_login.module \ip_login_attempt_login()

Checks the request IP and logs user in there's a match by calling ip_login_check then ip_login_attempt_login

Callback function for hook_menu

1 string reference to 'ip_login_attempt_login'
ip_login_menu in ./ip_login.module
Implementation of hook_menu().

File

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

Code

function ip_login_attempt_login() {
  $GLOBALS['conf']['cache'] = FALSE;

  // don't cache - not sure if this is correct usage
  $matched_uid = ip_login_check(ip_address());
  if ($matched_uid > 0) {
    ip_login_login($matched_uid);
  }
  drupal_goto(variable_get('ip_login_destination', 'user'));
}