function login_disable_settings_form in Login Disable 6
Same name and namespace in other branches
- 7 login_disable.module \login_disable_settings_form()
login_disable_settings_form function. Settings form for configurable options.
@access public
Return value
void
1 string reference to 'login_disable_settings_form'
- login_disable_menu in ./
login_disable.module - login_disable_menu function.
File
- ./
login_disable.module, line 119
Code
function login_disable_settings_form() {
$form = array();
$form['login_disable_is_active'] = array(
'#type' => 'checkboxes',
'#title' => 'Prevent user login',
'#description' => t('When active the user login form will be disabled for everyone. For roles granted bypass rights they must use the access key defined below.'),
'#options' => array(
'active' => t('Prevent unauthorised users logging in to the site'),
),
'#default_value' => variable_get('login_disable_is_active', array()),
);
$form['login_disable_key'] = array(
'#title' => t('Access Key'),
'#description' => t('Adding this word to the end of the @url url will allow access to the login form whilst it is disabled.', array(
'@url' => 'user/login?' . variable_get('login_disable_key', 'admin'),
)),
'#type' => 'textfield',
'#size' => 10,
'#default_value' => variable_get('login_disable_key', 'admin'),
);
//!@todo validate key string
$form['login_disable_message'] = array(
'#title' => t('End-user message when login is disabled'),
'#description' => t('Adding this word to the end of the @url url will allow access to the login form.', array(
'@url' => 'user/login?' . variable_get('login_disable_key', 'admin'),
)),
'#type' => 'textfield',
'#size' => 80,
'#default_value' => variable_get('login_disable_message', 'Member logins have been temporarily disabled. Please try again later.'),
);
$form = system_settings_form($form);
return $form;
}