1 user.module user_is_anonymous()

Determines if the current user is anonymous.

Return value

bool: TRUE if the user is anonymous, FALSE if the user is authenticated.

File

core/modules/user/user.module, line 1320
Enables the user registration and login system.

Code

function user_is_anonymous() {
  // Menu administrators can see items for anonymous when administering.
  return !$GLOBALS['user']->uid || !empty($GLOBALS['menu_admin']);
}