You are here

function session_limit_page_submit in Session Limit 6

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. 7.2 session_limit.module \session_limit_page_submit()

Handler for submissions from session_limit_page().

File

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

Code

function session_limit_page_submit($form, &$form_state) {
  global $user;

  // There used to be drupal_set_messages here for the disconnect,
  // but now that there is trigger/action support built in, you can add
  // a message through there and make it say whatever you want.
  if ($user->sid == $form_state['values']['sid']) {

    // force a normal logout for ourself.
    drupal_goto('logout');
  }
  else {
    session_limit_invoke_session_limit($form_state['values']['sid'], 'disconnect');

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