You are here

function session_limit_settings in Session Limit 5

Same name and namespace in other branches
  1. 6.2 session_limit.module \session_limit_settings()
  2. 6 session_limit.module \session_limit_settings()
  3. 7.2 session_limit.module \session_limit_settings()

Implementation of hook_settings().

1 string reference to 'session_limit_settings'
session_limit_menu in ./session_limit.module
Implementation of hook_menu(). Redirect user if over session limit.

File

./session_limit.module, line 12
Established Sessions do NOT need to verify every page load. new Session must deal w/ determining which connection is cut.

Code

function session_limit_settings() {
  $form = array();
  $form['session_limit_max'] = array(
    '#type' => 'select',
    '#title' => t('Maximum sessions per user'),
    '#description' => t('Select the maximum # of active sessions a user can have. 0 implies unlimited sessions.'),
    '#default_value' => variable_get('session_limit_max', 1),
    '#options' => range(0, 10),
  );
  $form['session_limit_auto_drop'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically drop the oldest session 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);
}