IP Login: automatic login via ip address

ABOUT

This module allows users to login first automatically via their IP address, instead of using a username / password.

HOW IT WORKS

When a user visits any Drupal page, IP Login:

  1. Checks if the user is not logged in and that IP login hasn't run yet for this session.
  2. If true, the module checks if a profile record exists for the user's IP address ( found in $_SERVER['REMOTE_ADDR'] ) by looking up the profile_values field in the DB.
  3. If a record is found in profile_values, IP Login logs the user in programmatically as the user with the matching IP address. Wildcard IP addresses such as 123.456.789.* are also available for corporate IP ranges etc...
  4. If a matching IP is not found, normal username / password authentication is still always available as a second step.

Note: The module uses the core 'Profile' module to store a user's IP address in a profile module field.

HOW TO INSTALL

  1. To associate an IP address with a user, create a user profile textfield ( admin/user/profile > add new field ) e.g: profile_ip. I recommend making it a private field, only available to admins. This will hold your user's ip address.
  2. Extract the archive and copy the module folder 'ip_login' to your module folder (e.g sites/all/modules/ )
  3. Enable the module from Drupal admin -> modules
  4. Go to the IP Login site config settings at admin/settings/iplogin and select the profile field that contains a user's IP address.
  5. Done.

HOW TO TEST

You can test it by entering your IP address in your user profile.

  1. If it's a local dev copy of the site, you can probably use localhost 127.0.0.1 for testing.
  2. You can tell it's working when you click the logout button and are logged back in by IP Login.
  3. IP Login displays a welcome message: "Welcome %name, you're now logged into %sitename"
  4. You should also be able to close the browser, open it, go to your site and see the welcome message indicating IP Login has logged you in.

Note: If you, or your users, need to find your/their external IP address, try http://whatismyip.com

Please Note: