You are here

function session_limit_page_submit in Session Limit 5

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

Handler for submissions from session_limit_page().

File

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

Code

function session_limit_page_submit($form_id, $form_values) {
  global $user;
  if ($user->sid == $form_values['sid']) {

    // force a normal logout for ourself.
    drupal_set_message(t('Your session has been disconnected.'));
    drupal_goto('logout');
  }
  else {
    _session_limit_disconnect($form_values['sid']);
    drupal_set_message(t('Session has been disconnected.'));

    // redirect to main page.
    drupal_goto();
  }
}