OSDN Git Service

Fixed: svn or ldap password can be found in clear text in the html source in editing...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 1 Dec 2007 22:03:45 +0000 (22:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 1 Dec 2007 22:03:45 +0000 (22:03 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@942 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/repositories_helper.rb
app/views/auth_sources/_form.rhtml

index 41218fa..333b30b 100644 (file)
@@ -62,7 +62,10 @@ module RepositoriesHelper
       content_tag('p', form.text_field(:url, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)) +
                        '<br />(http://, https://, svn://, file:///)') +
       content_tag('p', form.text_field(:login, :size => 30)) +
-      content_tag('p', form.password_field(:password, :size => 30))
+      content_tag('p', form.password_field(:password, :size => 30, :name => 'ignore',
+                                           :value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)),
+                                           :onfocus => "this.value=''; this.name='repository[password]';",
+                                           :onchange => "this.name='repository[password]';"))
   end
 
   def darcs_field_tags(form, repository)
index 24d2913..3d148c1 100644 (file)
 <%= text_field 'auth_source', 'account'  %></p>
 
 <p><label for="auth_source_account_password"><%=l(:field_password)%></label>
-<%= password_field 'auth_source', 'account_password'  %></p>
+<%= password_field 'auth_source', 'account_password', :name => 'ignore',
+                                           :value => ((@auth_source.new_record? || @auth_source.account_password.blank?) ? '' : ('x'*15)),
+                                           :onfocus => "this.value=''; this.name='auth_source[account_password]';",
+                                           :onchange => "this.name='auth_source[account_password]';" %></p>
 
 <p><label for="auth_source_base_dn"><%=l(:field_base_dn)%> <span class="required">*</span></label>
 <%= text_field 'auth_source', 'base_dn', :size => 60 %></p>