Feature #37679 » limit.patch
| app/models/user.rb | ||
|---|---|---|
|
# Login must contain letters, numbers, underscores only
|
||
|
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
|
||
|
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
|
||
|
validates_length_of :firstname, :lastname, :maximum => 30
|
||
|
validates_length_of :firstname, :maximum => 30
|
||
|
validates_length_of :lastname, :maximum => 255
|
||
|
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
|
||
|
Setting::PASSWORD_CHAR_CLASSES.each do |k, v|
|
||
|
validates_format_of :password, :with => v, :message => :"must_contain_#{k}", :allow_blank => true, :if => Proc.new {Setting.password_required_char_classes.include?(k)}
|
||