2023-07-17 21:15:18 +02:00
|
|
|
<?php declare(strict_types=1);
|
2022-12-20 21:17:03 +01:00
|
|
|
|
2023-03-09 14:23:28 +01:00
|
|
|
if (checkPassword($_SESSION['id'], $_POST['current-password']) !== true)
|
|
|
|
output(403, _('Wrong current password.'));
|
|
|
|
|
2022-12-20 21:17:03 +01:00
|
|
|
if (!isset($_POST['delete']))
|
2023-01-21 01:27:52 +01:00
|
|
|
output(403, _('Account deletion must be confirmed.'));
|
2022-12-20 21:17:03 +01:00
|
|
|
|
2023-06-08 17:36:44 +02:00
|
|
|
authDeleteUser($_SESSION['id']);
|
2022-12-20 21:17:03 +01:00
|
|
|
|
|
|
|
logout();
|
|
|
|
|
2023-01-21 01:27:52 +01:00
|
|
|
output(200, _('Account deleted.'));
|