You are here

function session_limit_user_settings in Session Limit 6

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

File

./session_limit.module, line 265
Limits multiple sessions per user.

Code

function session_limit_user_settings($args, $account) {
  $form['account'] = array(
    '#type' => 'value',
    '#value' => $account,
  );
  $form['session_limit'] = array(
    '#type' => 'select',
    '#title' => t('Maximum sessions'),
    '#description' => t('Total number simultaneous active sessions this user may have at one time. The default defers to the limits that apply to each of the user\'s roles.'),
    '#required' => FALSE,
    '#default_value' => empty($account->session_limit) ? 0 : $account->session_limit,
    '#options' => _session_limit_user_options(),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}