You are here

function nodejs_kick_user in Node.js integration 8

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

Kick a user from the node.js server.

Parameters

mixed $uid:

Return value

boolean TRUE if the user was kicked, FALSE otherwise.

1 string reference to 'nodejs_kick_user'
nodejs_drush_command in ./nodejs.drush.inc
Implements hook_drush_command().

File

./nodejs.module, line 105

Code

function nodejs_kick_user($uid) {

  // Http request went ok. Process Node.js server response.
  if ($node_response = nodejs_get_nodejs()
    ->kickUser($uid)) {
    if ($node_response->status == 'success') {
      return TRUE;
    }
    else {
      \Drupal::logger('nodejs')
        ->error(t('Error kicking uid "%uid" from the Node.js server. Server response: %error', array(
        '%uid' => $uid,
        '%error' => $node_response->error,
      )));
      return FALSE;
    }
  }
  else {
    return FALSE;
  }
}