× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Images,Videos,Music uploading
#11
Ahh. That makes sense. It would be super easy to add a button that says something like this:

Code:
$db->update('users',$user->data()->id,'permissions'=>0);

That would essentially let them ban themselves. It would leave all their data in the db in case they changed their mind and is probably the best way to avoid breaking things.
  Reply
#12
but doesn't cms's like wordpress remove users from the db ? i think that would be a better way to go surely?
  Reply
#13
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
  Reply
#14
So @mudmin I create a php file with that code and link it to a button?
@firestorm I'm actually using Bootstrap for the frontend so I wouldn't know.
  Reply
#15
Sure. You can essentially make a form with a button and then if that button was clicked, it would run that query that I gave you. If you are deleting the account, you might want to change the message from banned to deactivated in the us_helpers.php
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)