function session_limit_settings in Session Limit 6.2
Same name and namespace in other branches
- 5 session_limit.module \session_limit_settings()
- 6 session_limit.module \session_limit_settings()
- 7.2 session_limit.module \session_limit_settings()
Session Limit settings form.
1 string reference to 'session_limit_settings'
- session_limit_menu in ./
session_limit.module - Implementation of hook_menu().
File
- ./
session_limit.module, line 121 - Limits multiple sessions per user.
Code
function session_limit_settings() {
$form['session_limit_max'] = array(
'#type' => 'textfield',
'#title' => t('Default maximum number of active sessions'),
'#default_value' => variable_get('session_limit_max', 1),
'#size' => 2,
'#maxlength' => 3,
'#description' => t('The maximum number of active sessions a user can have. 0 implies unlimited sessions.'),
);
$limit_behaviours = array(
SESSION_LIMIT_DO_NOTHING => t('Do nothing.'),
SESSION_LIMIT_DROP => t('Automatically drop the oldest sessions without prompting.'),
SESSION_LIMIT_DISALLOW_NEW => t('Prevent new session.'),
);
$form['session_limit_behaviour'] = array(
'#type' => 'radios',
'#title' => t('When the session limit is exceeded'),
'#default_value' => variable_get('session_limit_behaviour', SESSION_LIMIT_DO_NOTHING),
'#options' => $limit_behaviours,
);
if (module_exists('masquerade')) {
$form['session_limit_masquerade_ignore'] = array(
'#type' => 'checkbox',
'#title' => t('Ignore masqueraded sessions.'),
'#description' => t("When a user administrator uses the masquerade module to impersonate a different user, it won't count against the session limit counter"),
'#default_value' => variable_get('session_limit_masquerade_ignore', FALSE),
);
}
$form['session_limit_logged_out_message_severity'] = array(
'#type' => 'select',
'#title' => t('Logged out message severity'),
'#default_value' => variable_get('session_limit_logged_out_message_severity', SESSION_LIMIT_LOGGED_OUT_MESSAGE_SEVERITY),
'#options' => array(
'error' => t('Error'),
'warning' => t('Warning'),
'status' => t('Status'),
'_none' => t('No Message'),
),
'#description' => t('The Drupal message type. Defaults to Error.'),
);
$form['session_limit_logged_out_message'] = array(
'#type' => 'textarea',
'#title' => t('Logged out message'),
'#default_value' => variable_get('session_limit_logged_out_message', SESSION_LIMIT_LOGGED_OUT_MESSAGE),
'#description' => t('The message that is displayed to a user if the workstation has been logged out.<br />
@number is replaced with the maximum number of simultaneous sessions.'),
);
return system_settings_form($form);
}