mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-03 23:53:23 +00:00
Use robots.txt instead of robots meta tag to prevent web crawlers from indexing login, register, and lost password form (#33658).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20577 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
135fd7b79f
commit
661c5646b4
@ -33,7 +33,3 @@
|
||||
<% else %>
|
||||
<%= javascript_tag "$('#username').focus();" %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
|
||||
@ -9,7 +9,3 @@
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
|
||||
@ -21,7 +21,3 @@
|
||||
</div>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
|
||||
@ -39,7 +39,3 @@
|
||||
|
||||
<%= submit_tag l(:button_submit) %>
|
||||
<% end %>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= robot_exclusion_tag %>
|
||||
<% end %>
|
||||
|
||||
@ -15,3 +15,6 @@ Disallow: <%= url_for(issues_path(:query_id => '')) %>
|
||||
Disallow: <%= url_for(issues_path) %>?*set_filter=
|
||||
Disallow: <%= url_for(issues_path(:trailing_slash => true)) %>*.pdf$
|
||||
Disallow: <%= url_for(projects_path(:trailing_slash => true)) %>*.pdf$
|
||||
Disallow: <%= url_for(signin_path) %>
|
||||
Disallow: <%= url_for(register_path) %>
|
||||
Disallow: <%= url_for(lost_password_path) %>
|
||||
|
||||
@ -32,7 +32,6 @@ class AccountControllerTest < Redmine::ControllerTest
|
||||
|
||||
assert_select 'input[name=username]'
|
||||
assert_select 'input[name=password]'
|
||||
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
|
||||
end
|
||||
|
||||
def test_get_login_while_logged_in_should_redirect_to_back_url_if_present
|
||||
@ -294,7 +293,6 @@ class AccountControllerTest < Redmine::ControllerTest
|
||||
|
||||
assert_select 'input[name=?]', 'user[password]'
|
||||
assert_select 'input[name=?]', 'user[password_confirmation]'
|
||||
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
|
||||
end
|
||||
end
|
||||
|
||||
@ -407,7 +405,6 @@ class AccountControllerTest < Redmine::ControllerTest
|
||||
get :lost_password
|
||||
assert_response :success
|
||||
assert_select 'input[name=mail]'
|
||||
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
|
||||
end
|
||||
|
||||
def test_lost_password_for_active_user_should_create_a_token
|
||||
@ -527,7 +524,6 @@ class AccountControllerTest < Redmine::ControllerTest
|
||||
assert_response :success
|
||||
|
||||
assert_select 'input[type=hidden][name=token][value=?]', token.value
|
||||
assert_select 'head>meta[name="robots"][content=?]', 'noindex,follow,noarchive'
|
||||
end
|
||||
|
||||
def test_get_lost_password_with_invalid_token_should_redirect
|
||||
|
||||
@ -33,5 +33,8 @@ class WelcomeTest < Redmine::IntegrationTest
|
||||
assert @response.body.match(%r{^Disallow: /issues\?\*set_filter=\r?$})
|
||||
assert @response.body.match(%r{^Disallow: /issues/\*\.pdf\$\r?$})
|
||||
assert @response.body.match(%r{^Disallow: /projects/\*\.pdf\$\r?$})
|
||||
assert @response.body.match(%r{^Disallow: /login\r?$})
|
||||
assert @response.body.match(%r{^Disallow: /account/register\r?$})
|
||||
assert @response.body.match(%r{^Disallow: /account/lost_password\r?$})
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user