Generates a default anonymous $user object.
Object - the user object.
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;
}