08-19-2016, 07:26 PM
I guess it depends. For one, I just gave an answer in a single line of code. It may not be the best way, but it works. Sites like facebook never truly delete your profile because the data is valuable. Also, database space is cheap until you get into hundreds of thousands of users.
Here are the things to consider.
If you truly delete the profile, what do you want to delete? Do you also want to delete their bio? What if you created a forum with userspice. Does it delete their posts? What if someone replied to that post? What if there is a link on the post where you click the username and that user has been deleted? Does that give you a 404 error?
The thing with UserSpice is that I never know what someone is going to actually do with the framework, so I try not to make features that have unintended consequences. Anyone is welcome to mod the system to go around and delete the user, bio, permissions, and all content. It's super easy.
If you're interested in doing that, just write a bunch of queries in a row that attach to the $user->data()id
For the profile you would delete WHERE user_id = $user->data()id and so on. It's not hard. Just think of the consequences if someone tries to access that data.
So for the bio
Here are the things to consider.
If you truly delete the profile, what do you want to delete? Do you also want to delete their bio? What if you created a forum with userspice. Does it delete their posts? What if someone replied to that post? What if there is a link on the post where you click the username and that user has been deleted? Does that give you a 404 error?
The thing with UserSpice is that I never know what someone is going to actually do with the framework, so I try not to make features that have unintended consequences. Anyone is welcome to mod the system to go around and delete the user, bio, permissions, and all content. It's super easy.
If you're interested in doing that, just write a bunch of queries in a row that attach to the $user->data()id
For the profile you would delete WHERE user_id = $user->data()id and so on. It's not hard. Just think of the consequences if someone tries to access that data.
So for the bio