You are here

function session_limit_settings in Session Limit 6

Same name and namespace in other branches
  1. 5 session_limit.module \session_limit_settings()
  2. 6.2 session_limit.module \session_limit_settings()
  3. 7.2 session_limit.module \session_limit_settings()
1 string reference to 'session_limit_settings'
session_limit_menu in ./session_limit.module
Implementation of hook_menu().

File

./session_limit.module, line 93
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.'),
  );
  $form['session_limit_auto_drop'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically drop the oldest sessions without prompting.'),
    '#default_value' => variable_get('session_limit_auto_drop', 0),
  );
  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),
    );
  }
  return system_settings_form($form);
}