Class: AnonymousUser

Inherits:
User show all
Defined in:
app/models/user.rb

Constant Summary

Constants inherited from User

User::MAIL_NOTIFICATION_OPTIONS, User::STATUS_ACTIVE, User::STATUS_ANONYMOUS, User::STATUS_LOCKED, User::STATUS_REGISTERED, User::USER_FORMATS

Instance Attribute Summary

Attributes inherited from User

#last_before_login_on, #password, #password_confirmation

Instance Method Summary collapse

Methods inherited from User

#activate, #activate!, #active?, anonymous, #anonymous?, #api_key, #before_create, #before_save, #change_password_allowed?, #check_password?, current, current=, #deletable?, find_by_api_key, find_by_login, find_by_mail, find_by_rss_key, #identity_url=, #lock, #lock!, #locked?, #mail=, #member_of?, #notified_project_ids=, #notified_projects_ids, #notify_about?, #pref, #projects_by_role, #random_password, #register, #register!, #registered?, #reload, #salt_password, salt_unsalted_passwords!, #to_s, #today, try_to_autologin, try_to_login, valid_notification_options, #valid_notification_options, #wants_comments_in_reverse_order?

Methods included from Redmine::SafeAttributes

#delete_unsafe_attributes, included, #safe_attribute_names, #safe_attributes=

Methods inherited from Principal

#<=>, #active?, #allowed_to?, #allowed_to_globally?, #roles_for_project, #to_liquid

Instance Method Details

#adminObject


515
# File 'app/models/user.rb', line 515

def admin; false end

#available_custom_fieldsObject


509
510
511
# File 'app/models/user.rb', line 509

def available_custom_fields
  []
end

#logged?Boolean

Overrides a few properties


514
# File 'app/models/user.rb', line 514

def logged?; false end

#mailObject


517
# File 'app/models/user.rb', line 517

def mail; nil end

#name(*args) ⇒ Object


516
# File 'app/models/user.rb', line 516

def name(*args); I18n.t(:label_user_anonymous) end

#rss_keyObject


519
# File 'app/models/user.rb', line 519

def rss_key; nil end

#time_zoneObject


518
# File 'app/models/user.rb', line 518

def time_zone; nil end

#validate_on_createObject


504
505
506
507
# File 'app/models/user.rb', line 504

def validate_on_create
  # There should be only one AnonymousUser in the database
  errors.add_to_base 'An anonymous user already exists.' if AnonymousUser.find(:first)
end