You are here

function nodejs_logout_user in Node.js integration 6

Same name and namespace in other branches
  1. 8 nodejs.module \nodejs_logout_user()
  2. 7 nodejs.module \nodejs_logout_user()

Logout any sockets associated with the given token from the node.js server.

Parameters

mixed $token:

1 call to nodejs_logout_user()
nodejs_user_logout in ./nodejs.module
Implements hook_user_logout().

File

./nodejs.module, line 67

Code

function nodejs_logout_user($token) {
  $response = Nodejs::logoutUser($token);
  if (isset($response->error)) {
    watchdog('nodejs', t('Error logging out token "%token" from the Node.js server: [%code] %error', array(
      '%token' => $token,
      '%code' => $response->code,
      '%error' => $response->error,
    )));
    return FALSE;
  }
  else {
    return $response;
  }
}