You are here

function httprl_set_user in HTTP Parallel Request & Threading Library 7

Same name and namespace in other branches
  1. 6 httprl.module \httprl_set_user()

Sets the global user to the given user ID.

Parameters

int $uid: Integer specifying the user ID to load.

1 call to httprl_set_user()
httprl_async_page in ./httprl.async.inc
Menu Callback; run given function.

File

./httprl.module, line 3398
HTTP Parallel Request Library module.

Code

function httprl_set_user($uid) {
  $account = user_load($uid);
  if (!empty($account)) {
    $GLOBALS['user'] = $account;
    if (defined('VERSION') && substr(VERSION, 0, 1) >= 7) {
      drupal_save_session(FALSE);
    }
    else {
      session_save_session(FALSE);
    }
    return TRUE;
  }
}