You are here

function nodejs_user_set_online in Node.js integration 8

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

Set the user as online.

Parameters

$uid:

2 calls to nodejs_user_set_online()
NodejsPages::messageHandler in src/Controller/NodejsPages.php
@todo .
nodejs_auth_check in ./nodejs.module
Checks the given key to see if it matches a valid session.

File

./nodejs.module, line 547

Code

function nodejs_user_set_online($uid) {
  try {
    \Drupal::database()
      ->query('INSERT INTO {nodejs_presence} (uid, login_time) VALUES (:uid, :login_time)', array(
      ':uid' => $uid,
      ':login_time' => time(),
    ));
  } catch (Exception $e) {
  }
}