You are here

function autologout_autologout_prevent in Automated Logout 6.4

Same name and namespace in other branches
  1. 8 autologout.module \autologout_autologout_prevent()
  2. 7.4 autologout.module \autologout_autologout_prevent()

Implements hook_autologout_prevent().

File

./autologout.module, line 430
Used to automagically log out a user after a preset time.

Code

function autologout_autologout_prevent() {
  global $user;

  // Don't include autologout JS checks on ajax callbacks.
  $paths = array(
    'ajax',
    'autologout_ajax_get_time_left',
    'autologout_ahah_logout',
    'autologout_ahah_set_last',
  );
  if (in_array(arg(0), $paths)) {
    return TRUE;
  }

  // If user is anonymous or has no timeout set.
  if (empty($user->uid) || !_autologout_get_user_timeout()) {
    return TRUE;
  }

  // If the user has checked remember_me via the remember_me module.
  if (!empty($user->remember_me)) {
    return TRUE;
  }
}