function 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.

4 calls to user_is_anonymous()
CommentFormController::save in drupal/core/modules/comment/lib/Drupal/comment/CommentFormController.php
Overrides Drupal\Core\Entity\EntityFormController::save().
MaintenanceModeSubscriber::onKernelRequestMaintenance in drupal/core/modules/user/lib/Drupal/user/EventSubscriber/MaintenanceModeSubscriber.php
Determine whether the page is configured to be offline.
RegisterAccessCheck::access in drupal/core/modules/user/lib/Drupal/user/Access/RegisterAccessCheck.php
Implements AccessCheckInterface::access().
user_register_access in drupal/core/modules/user/user.module
Determines if the current user has access to the user registration page.
1 string reference to 'user_is_anonymous'
user_menu in drupal/core/modules/user/user.module
Implements hook_menu().

File

drupal/core/modules/user/user.module, line 825
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']);
}