You are here

function drupalchat_ex_auth in DrupalChat 7.2

Same name and namespace in other branches
  1. 6.2 drupalchat.module \drupalchat_ex_auth()
  2. 7 drupalchat.module \drupalchat_ex_auth()
1 string reference to 'drupalchat_ex_auth'
drupalchat_menu in ./drupalchat.module
Implements hook_menu().

File

./drupalchat.module, line 1364
Module code for DrupalChat.

Code

function drupalchat_ex_auth() {
  global $user;
  $json = array();
  if (user_is_logged_in()) {
    $json = _drupalchat_get_auth(array());
    if (gettype($json) == 'object') {
      if ($json->code != 200) {
        $error = array(
          'code' => $json->code,
          'error' => $json->error,
        );
        $json = $error;
      }
    }
  }
  drupal_json_output($json);
}