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:
- Checks if the user is not logged in and that IP login hasn't run yet for this session.
- 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.
- 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...
- 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
- 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.
- Extract the archive and copy the module folder 'ip_login' to your module folder (e.g sites/all/modules/ )
- Enable the module from Drupal admin -> modules
- Go to the IP Login site config settings at admin/settings/iplogin and select the profile field that contains a user's IP address.
- Done.
HOW TO TEST
You can test it by entering your IP address in your user profile.
- If it's a local dev copy of the site, you can probably use localhost 127.0.0.1 for testing.
- You can tell it's working when you click the logout button and are logged back in by IP Login.
- IP Login displays a welcome message: "Welcome %name, you're now logged into %sitename"
- 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:
-
This module is not suitable for use with users who have dynamically assigned, changing, IP addresses. This is because another user may login when assigned the same IP address as a previous valid user. It is however suitable for use with users who always access your site from a static IP.
- This module does not write to the profile_ip field. Adding the user's IP address should be done manually by the website administrator or privileged user.