mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
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:
parent
f4ee1278e5
commit
7df8dc8bcb
5 changed files with 45 additions and 0 deletions
|
@ -55,6 +55,22 @@ if (isset($_COOKIE["AURSID"])) {
|
|||
}
|
||||
}
|
||||
|
||||
} elseif ($action == "DeleteAccount") {
|
||||
/* Details for account being deleted. */
|
||||
$acctinfo = account_details(in_request('ID'), in_request('U'));
|
||||
|
||||
if (can_edit_account($acctinfo)) {
|
||||
$UID = $acctinfo['ID'];
|
||||
if (in_request('confirm_Delete') && check_token()) {
|
||||
user_delete($UID);
|
||||
header('Location: /');
|
||||
} else {
|
||||
$username = $acctinfo['Username'];
|
||||
include("account_delete.php");
|
||||
}
|
||||
} else {
|
||||
print __("You do not have permission to edit this account.");
|
||||
}
|
||||
} elseif ($action == "AccountInfo") {
|
||||
# no editing, just looking up user info
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue