You are here

function session_limit_user_max_sessions in Session Limit 6

Same name and namespace in other branches
  1. 6.2 session_limit.module \session_limit_user_max_sessions()
  2. 7.2 session_limit.module \session_limit_user_max_sessions()
5 calls to session_limit_user_max_sessions()
session_limit_help in ./session_limit.module
Implementation of hook_help().
session_limit_init in ./session_limit.module
Implementation of hook_init().
session_limit_page in ./session_limit.module
Display/Delete sessions..
session_limit_session_limit in ./session_limit.module
Implementation of hook_trigger_name().
session_limit_token_values in ./session_limit.module
Implementation of hook_token_values().

File

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

Code

function session_limit_user_max_sessions($account = array()) {
  if (empty($account)) {
    global $user;
    $account = $user;
  }
  static $limits;
  if (isset($limits[0])) {
    return $limits[0];
  }
  $limits['default'] = check_plain(variable_get('session_limit_max', 1));
  $limits['user'] = session_limit_user_max_sessions_byuser($account);
  $limits['role'] = session_limit_user_max_sessions_byrole($account);
  rsort($limits);
  return check_plain($limits[0]);
}