You are here

function session_limit_page_submit in Session Limit 7.2

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

Handler for submissions from session_limit_page().

File

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

Code

function session_limit_page_submit($form, &$form_state) {
  global $user;
  $session_reference = $form_state['values']['session_reference'];
  $sid = $form['active_sessions']['#value'][$session_reference];
  if ($user->sid == $sid) {
    drupal_goto('user/logout');
  }
  else {
    session_limit_invoke_session_limit($sid, 'disconnect');
    drupal_goto();
  }
}