eristoddle
12/5/2012 - 3:06 PM

Drupal is user logged in JavaScript

Drupal is user logged in JavaScript

global $user;
  $loggedin = 0;
  if ($user->uid) {
    $loggedin = 1;
  } 
drupal_add_js(array('mymodule'=>array('loggedin' => $loggedin)), 'setting');