drupal_anonymous_user

Versions
mediamosa-21
drupal_anonymous_user($session = '')

Generates a default anonymous $user object.

Return value

Object - the user object.

▾ 9 functions call drupal_anonymous_user()

comment_form_node_type_form_alter in modules/comment/comment.module
Implements hook_form_FORM_ID_alter().
drupal_cron_run in includes/common.inc
Executes a cron run when called.
drupal_session_initialize in includes/session.inc
Initialize the session handler, starting a session if needed.
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either logs in or registers the current user, based on username. Either way, the global $user object is populated and login tasks are performed.
user_register_form in modules/user/user.module
Form builder; the user registration form.
_drupal_bootstrap_page_cache in includes/bootstrap.inc
Bootstrap page cache: Try to serve a page from cache.
_drupal_session_destroy in includes/session.inc
Session handler assigned by session_set_save_handler().
_drupal_session_read in includes/session.inc
Session handler assigned by session_set_save_handler().

Code

includes/bootstrap.inc, line 1716

<?php
function drupal_anonymous_user($session = '') {
  $user = new stdClass();
  $user->uid = 0;
  $user->hostname = ip_address();
  $user->roles = array();
  $user->roles[DRUPAL_ANONYMOUS_RID] = 'anonymous user';
  $user->session = $session;
  $user->cache = 0;
  return $user;
}
?>