Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
yanxd 2014-01-23 08:09:31 +08:00
commit 7a047641ee
2 changed files with 3 additions and 3 deletions

View File

@ -130,13 +130,13 @@ class User < Principal
LOGIN_LENGTH_LIMIT = 60 LOGIN_LENGTH_LIMIT = 60
MAIL_LENGTH_LIMIT = 60 MAIL_LENGTH_LIMIT = 60
validates_presence_of :login, :firstname, :lastname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) } validates_presence_of :login, :firstname, :mail, :if => Proc.new { |user| !user.is_a?(AnonymousUser) }
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
# Login must contain letters, numbers, underscores only # Login must contain letters, numbers, underscores only
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
validates_length_of :firstname, :lastname, :maximum => 30 validates_length_of :firstname, :maximum => 30
validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true validates_format_of :mail, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :allow_blank => true
validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true validates_length_of :mail, :maximum => MAIL_LENGTH_LIMIT, :allow_nil => true
validates_confirmation_of :password, :allow_nil => true validates_confirmation_of :password, :allow_nil => true

View File

@ -287,7 +287,7 @@
<% end %> <% end %>
<span id = 'name' style = 'display:none'> <span id = 'name' style = 'display:none'>
<p><%= f.text_field :firstname, :required => true %></p> <p><%= f.text_field :firstname, :required => true %></p>
<p><%= f.text_field :lastname, :required => true %></p> <!--<p><%= f.text_field :lastname, :required => true %></p>-->
</span> </span>
<span id = 'enterprise' style = 'display:none'> <span id = 'enterprise' style = 'display:none'>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong>企业名<span class="required"> *</span></strong></td> <p><table><tr><td class="info" align="right" style="width: 90px"><strong>企业名<span class="required"> *</span></strong></td>