Add support for deleting user accounts

Users can now delete their own accounts by clicking a link in the
account edit form and confirming the deletion on a follow-up page.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-07-25 11:04:19 +02:00
parent f4ee1278e5
commit 7df8dc8bcb
5 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,22 @@
<p>
<?= __('You can use this form to permanently delete the AUR account %s.', '<strong>' . htmlspecialchars($username) . '</strong>') ?>
</p>
<p>
<?= __('%sWARNING%s: This action cannot be undone.', '<strong>', '</strong>') ?>
</p>
<form id="edit-profile-form" action="<?= get_user_uri($username) . 'delete/'; ?>" method="post">
<fieldset>
<input type="hidden" name="Action" value="<?= $A ?>" />
<input type="hidden" name="ID" value="<?= $UID ?>" />
<input type="hidden" name="token" value="<?= htmlspecialchars($_COOKIE['AURSID']) ?>" />
</fieldset>
<fieldset>
<p><input type="checkbox" name="confirm_Delete" value="1" />
<?= __("Confirm deletion") ?></p>
<p>
<input type="submit" class="button" value="<?= __("Delete") ?>" />
</p>
</fieldset>
</form>