diff --git a/app/models/user.rb b/app/models/user.rb index db66b1b..6ddd9ee 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,7 +15,7 @@ class User < ActiveRecord::Base # FIXME ugly workaround def self.human_attribute_name(attrib) case attrib.to_sym - when :login: return _('Username') + when :login: return [_('Username'), _('Email')].join(' / ') when :email: return _('e-Mail') else _(self.superclass.human_attribute_name(attrib)) end @@ -116,7 +116,7 @@ class User < ActiveRecord::Base validates_inclusion_of :terms_accepted, :in => [ '1' ], :if => lambda { |u| ! u.terms_of_use.blank? }, :message => N_('%{fn} must be checked in order to signup.').fix_i18n - # Authenticates a user by their login name and unencrypted password. Returns the user or nil. + # Authenticates a user by their login name or email and unencrypted password. Returns the user or nil. def self.authenticate(login, password, environment = nil) environment ||= Environment.default u = self.first :conditions => ['(login = ? OR email = ?) AND environment_id = ? AND activated_at IS NOT NULL', -- libgit2 0.21.2