Work progress on account deletion

This commit is contained in:
Pierre
2018-05-09 14:53:08 +02:00
parent 3841d85c64
commit 400d9ab07d
2 changed files with 61 additions and 0 deletions

View File

@ -110,4 +110,24 @@ class accountController {
"success" => "The account has been created !"
);
}
/**
* Delete an account
*
* @url POST /account/delete
*/
public function deleteAccount(){
//Login & valid password required
user_login_required();
check_post_password(userID, "password");
//Try to delet the account
if(!components()->account->delete(userID))
Rest_fatal_error(500, "An error occurred while trying to delete your account!");
//Success
return array("success" => "The user account has been successfully deleted!");
}
}