summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-12-10 00:57:38 +0000
committerGo MAEDA <maeda@farend.jp>2020-12-10 00:57:38 +0000
commit086c95569e629b47049e308f627916df7182fb5f (patch)
tree85c7c694f22d5666dbb4e405081e903930d66e7f /app/views
parent461fe8304fad30042a6a42c0d451ee9651dc62c8 (diff)
downloadredmine-086c95569e629b47049e308f627916df7182fb5f.tar.gz
redmine-086c95569e629b47049e308f627916df7182fb5f.zip
Require explicit confirmation before deleting a user (#34417).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@20600 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/users/destroy.html.erb20
-rw-r--r--app/views/users/index.html.erb2
2 files changed, 21 insertions, 1 deletions
diff --git a/app/views/users/destroy.html.erb b/app/views/users/destroy.html.erb
new file mode 100644
index 000000000..6478519b1
--- /dev/null
+++ b/app/views/users/destroy.html.erb
@@ -0,0 +1,20 @@
+<%= title l(:label_confirmation) %>
+
+<%= form_tag user_path(@user), method: :delete do %>
+<div class="warning">
+ <p><strong><%= @user.name %> (<%= @user.login %>)</strong></p>
+
+ <p><%= l :text_user_destroy_confirmation, login: @user.login %></p>
+
+ <p>
+ <label for="confirm"><%= l :field_login %></label>
+ <%= text_field_tag 'confirm' %>
+ </p>
+</div>
+
+<p>
+ <%= submit_tag l(:button_delete) %>
+ <%= submit_tag l(:button_lock), name: 'lock' unless @user.locked? %>
+ <%= link_to l(:button_cancel), users_path %>
+</p>
+<% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index b92df96f1..7987d3b99 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -53,7 +53,7 @@
<td class="last_login_on"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
<td class="buttons">
<%= change_status_link(user) %>
- <%= delete_link user_path(user, :back_url => request.original_fullpath) unless User.current == user %>
+ <%= delete_link user_path(user, :back_url => request.original_fullpath), :data => {} unless User.current == user %>
</td>
</tr>
<% end -%>