function ip_login_admin_settings in IP Login 6
Same name and namespace in other branches
- 5 ip_login.module \ip_login_admin_settings()
- 6.2 ip_login.admin.inc \ip_login_admin_settings()
- 7.3 ip_login.admin.inc \ip_login_admin_settings()
- 7.2 ip_login.admin.inc \ip_login_admin_settings()
1 string reference to 'ip_login_admin_settings'
- ip_login_menu in ./
ip_login.module - Implementation of hook_menu
File
- ./
ip_login.module, line 33
Code
function ip_login_admin_settings() {
$result = db_query("SELECT DISTINCT name FROM {profile_fields}");
while ($field = db_fetch_object($result)) {
$fields[$field->name] = $field->name;
}
if (!$fields || !variable_get('ip_login_profile_ip_field', '')) {
drupal_set_message(t('You can use the !profile_module to add a text field to the user profile to store the user ip address.', array(
'!profile_module' => l('profile module admin', 'admin/user/profile/add/textfield'),
)));
}
$form['info'] = array(
'#type' => 'markup',
'#value' => 'This module allows users to login automatically by IP address. The IP address value stored in a user\'s profile, using the \'profile\' module, is used to authenticate and login that user when visiting from that address. Addresses like 203.123.456.789 and also ranges like 203.123.456.* are supported.',
);
$form['ip_login_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('IP Login enabled'),
'#description' => t('Check to enable IP Login, uncheck to disable. If unchecked no user will be able to login via IP address.'),
'#default_value' => variable_get('ip_login_enabled', 1),
);
$form['ip_login_profile_ip_field'] = array(
'#type' => 'select',
'#title' => t('Profile module IP address field'),
'#description' => t('Select the profile field containing the user IP address.'),
'#options' => $fields,
'#default_value' => variable_get('ip_login_profile_ip_field', 'profile_ip'),
);
return system_settings_form($form);
}