mirror of
https://github.com/TracksApp/tracks.git
synced 2026-04-18 01:59:02 +02:00
Improved reliability of ldap test (somewhat... it's still very environment specific).
Fixed validations in User model. Updated environment.rb.tmpl to be a little easier to follow. A note for upgraders. Be sure to include the following line in your environment.rb: AUTHENTICATION_SCHEMES = ['database'] See environment.rb.tmpl for details git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@337 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
b57765486d
commit
4caca8db70
3 changed files with 32 additions and 4 deletions
|
|
@ -56,10 +56,14 @@ protected
|
|||
def crypt_password
|
||||
write_attribute("password", self.class.sha1(password)) if password == @password_confirmation
|
||||
end
|
||||
|
||||
def password_required?
|
||||
auth_type == 'database'
|
||||
end
|
||||
|
||||
validates_presence_of :login
|
||||
validates_presence_of :password, :if => Proc.new{|user| user.auth_type == 'database'}
|
||||
validates_length_of :password, :within => 5..40
|
||||
validates_presence_of :password, :if => :password_required?
|
||||
validates_length_of :password, :within => 5..40, :if => :password_required?
|
||||
validates_confirmation_of :password
|
||||
validates_length_of :login, :within => 3..80
|
||||
validates_uniqueness_of :login, :on => :create
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue