mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Work progress on account deletion
This commit is contained in:
@ -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!");
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user