function drupal_anonymous_user

cis7 bootstrap.inc drupal_anonymous_user()
cle7 bootstrap.inc drupal_anonymous_user()
elmsmedia7 bootstrap.inc drupal_anonymous_user()
icor7 bootstrap.inc drupal_anonymous_user()
meedjum_blog7 bootstrap.inc drupal_anonymous_user()
mooc7 bootstrap.inc drupal_anonymous_user()

Generates a default anonymous $user object.

Return value

Object - the user object.

21 calls to drupal_anonymous_user()
comment_form_node_type_form_alter in modules/comment/comment.module
Implements hook_form_FORM_ID_alter().
devel_block_configure in sites/all/modules/ulmus/devel/devel.module
Implementation of hook_block_configure().
devel_create_users in sites/all/modules/ulmus/devel/devel_generate/devel_generate.inc
Generate some random users.
devel_switch_user_list in sites/all/modules/ulmus/devel/devel.module
DrupalWebTestCase::drupalCreateUser in modules/simpletest/drupal_web_test_case.php
Create a user with a given set of permissions.

... See full list

File

includes/bootstrap.inc, line 2152
Functions that need to be loaded on every Drupal request.

Code

function drupal_anonymous_user() {
  $user = variable_get('drupal_anonymous_user_object', new stdClass);
  $user->uid = 0;
  $user->hostname = ip_address();
  $user->roles = array();
  $user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
  $user->cache = 0;
  return $user;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.