You are here

function _autologout_user_in_by_user_role in Automated Logout 5

Same name and namespace in other branches
  1. 6 autologout.module \_autologout_user_in_by_user_role()
  2. 6.2 autologout.module \_autologout_user_in_by_user_role()
  3. 7.2 autologout.module \_autologout_user_in_by_user_role()
1 call to _autologout_user_in_by_user_role()
autologout_user in ./autologout.module
Implementation of hook_user()

File

./autologout.module, line 458
Used to automagically log out a user after a preset time, AjK May 2006

Code

function _autologout_user_in_by_user_role($passed_user = FALSE) {
  global $user;
  if (FALSE == $passed_user) {
    $local_user = user_load(array(
      'uid' => $user->uid,
    ));
  }
  else {
    $local_user = $passed_user;
  }
  foreach (user_roles(TRUE) as $role) {
    if (_autologout_local_settings($role) == 2 && in_array($role, $local_user->roles)) {
      return TRUE;
    }
  }
  return FALSE;
}