Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By mickh on
Sorry to bother you with such a trivial question but I'm getting nowhere searching the forums or browsing the API docs ...
Is there a Drupal variable of some kind available that simply indicates whether the current user is logged in or not?
Better still, is there a document somewhere that details this and all similar variables?
Thanks
Comments
Handbook
The global $user object is always available, and $user->uid will be zero for any visitor. Anything else is logged in.
Read the theme developer's handbook for explanations of variables that are available in the context of page, node and block templates.
there is if
there is if (user_is_logged_in()) {.... function to use in d6 i suppose there is also in d5 :-)
Adriadrop Drupal development