validates_length_of :firstname, :lastname, :maximum => 30
validates_format_of :mail, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_nil => true
validates_length_of :mail, :maximum => 60, :allow_nil => true
- validates_length_of :password, :minimum => 4, :allow_nil => true
validates_confirmation_of :password, :allow_nil => true
def before_create
anonymous_user
end
-private
+ protected
+
+ def validate
+ # Password length validation based on setting
+ if !password.nil? && password.size < Setting.password_min_length.to_i
+ errors.add(:password, :too_short, :count => Setting.password_min_length.to_i)
+ end
+ end
+
+ private
+
# Return password digest
def self.hash_password(clear_password)
Digest::SHA1.hexdigest(clear_password || "")
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label>
<%= password_field_tag 'password', nil, :size => 25 %><br />
-<em><%= l(:text_caracters_minimum, 4) %></em></p>
+<em><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
<p><label for="password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'password_confirmation', nil, :size => 25 %></p>
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password', nil, :size => 25 %><br />
-<em><%= l(:text_caracters_minimum, 4) %></em></p>
+<em><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
<p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
[l(:label_registration_automatic_activation), "3"]
], Setting.self_registration ) %></p>
+<p><label><%= l(:setting_password_min_length) %></label>
+<%= text_field_tag 'settings[password_min_length]', Setting.password_min_length, :size => 6 %></p>
+
<p><label><%= l(:label_password_lost) %></label>
<%= check_box_tag 'settings[lost_password]', 1, Setting.lost_password? %><%= hidden_field_tag 'settings[lost_password]', 0 %></p>
<div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>">
<p><label for="password"><%=l(:field_password)%><span class="required"> *</span></label>
<%= password_field_tag 'password', nil, :size => 25 %><br />
-<em><%= l(:text_caracters_minimum, 4) %></em></p>
+<em><%= l(:text_caracters_minimum, :count => Setting.password_min_length) %></em></p>
<p><label for="password_confirmation"><%=l(:field_password_confirmation)%><span class="required"> *</span></label>
<%= password_field_tag 'password_confirmation', nil, :size => 25 %></p>
</div>
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page\r
text_wiki_page_nullify_children: Keep child pages as root pages\r
text_wiki_page_destroy_children: Delete child pages and all their descendants\r
+ setting_password_min_length: Minimum password length\r
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
setting_file_max_size_displayed: Max size of text files displayed inline
setting_repository_log_display_limit: Maximum number of revisions displayed on file log
setting_openid: Allow OpenID login and registration
+ setting_password_min_length: Minimum password length
permission_edit_project: Edit project
permission_select_project_modules: Select project modules
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
setting_file_max_size_displayed: Taille maximum des fichiers texte affichés en ligne
setting_repository_log_display_limit: "Nombre maximum de revisions affichées sur l'historique d'un fichier"
setting_openid: "Autoriser l'authentification et l'enregistrement OpenID"
+ setting_password_min_length: Longueur minimum des mots de passe
permission_edit_project: Modifier le projet
permission_select_project_modules: Choisir les modules
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
text_wiki_page_reassign_children: Reassign child pages to this parent page
text_wiki_page_nullify_children: Keep child pages as root pages
text_wiki_page_destroy_children: Delete child pages and all their descendants
+ setting_password_min_length: Minimum password length
default: '2'
lost_password:
default: 1
+password_min_length:
+ format: int
+ default: 4
attachment_max_size:
format: int
default: 5120