summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-12-10 01:09:33 +0000
committerGo MAEDA <maeda@farend.jp>2020-12-10 01:09:33 +0000
commit586ff28733388da6a6d944af081228f3b21b8607 (patch)
treef98c5f57f1643f41059550813b9e61ac140528f9 /app
parent086c95569e629b47049e308f627916df7182fb5f (diff)
downloadredmine-586ff28733388da6a6d944af081228f3b21b8607.tar.gz
redmine-586ff28733388da6a6d944af081228f3b21b8607.zip
Require to enter project's identifier to confirm project deletion (#34417).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@20601 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb2
-rw-r--r--app/views/projects/destroy.html.erb9
2 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 934a934b5..de05fdb35 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -275,7 +275,7 @@ class ProjectsController < ApplicationController
end
@project_to_destroy = @project
- if api_request? || params[:confirm]
+ if api_request? || params[:confirm] == @project_to_destroy.identifier
@project_to_destroy.destroy
respond_to do |format|
format.html do
diff --git a/app/views/projects/destroy.html.erb b/app/views/projects/destroy.html.erb
index 15a54d1cc..f2c97449b 100644
--- a/app/views/projects/destroy.html.erb
+++ b/app/views/projects/destroy.html.erb
@@ -12,9 +12,16 @@
content_tag('strong', @project_to_destroy.descendants.collect{|p| p.to_s}.join(', '))).html_safe %>
<% end %>
</p>
+
<p>
- <label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label>
+ <%= l :text_project_destroy_enter_identifier, identifier: @project_to_destroy.identifier %>
</p>
+
+<p>
+ <label for="confirm"><%= l :field_identifier %></label>
+ <%= text_field_tag 'confirm' %>
+</p>
+
</div>
<p>