users: move account deletion endpoint to /users/:id/deactivate.

Move the account deletion endpoint from /maintenance/users/deletion to either:

* https://danbooru.donmai.us/users/deactivate
* https://danbooru.donmai.us/users/:id/deactivate

This incidentally allows the Owner-level user to deactivate accounts belonging to other users. This
is meant for things like deactivating inactive accounts with invalid or abusive names. This is
limited to accounts below Gold level for security.
This commit is contained in:
evazion
2022-11-05 18:31:49 -05:00
parent 59872d2ed5
commit 3ffde5b23d
10 changed files with 163 additions and 112 deletions

View File

@@ -1,40 +0,0 @@
<% page_title "Deactivate Account" %>
<div id="c-maintenance-user-deletions">
<div id="a-show" class="prose">
<h1>Deactivate Account</h1>
<p>
You can deactivate your <%= Danbooru.config.app_name %> account using
the form below. Deactivating your account will do the following things:
</p>
<ul>
<li>Change your name to a generic name</li>
<li>Delete your favorites</li>
<li>Delete your saved searches</li>
<li>Delete your password and email address</li>
<li>Delete your account settings</li>
</ul>
<p>
The following things will <strong>not</strong> be deleted:
</p>
<ul>
<li>Posts you've uploaded</li>
<li>Comments, forum posts, and private messages</li>
<li>Tag edits, wiki edits, translation notes, or any other contributions to the site</li>
</ul>
<p>
Enter your password below to deactivate your account. This cannot be
undone. Your account cannot be recovered after it is deactivated.
</p>
<%= edit_form_for(:user, url: maintenance_user_deletion_path, method: :delete) do |f| %>
<%= f.input :password %>
<%= f.submit "Deactivate account", "data-confirm": "Are you sure you want to deactivate your account? This cannot be undone" %>
<% end %>
</div>
</div>