Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How I can to delete user from forum?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://myhost/adminUsers/list.page - can't find button delete. :-(
[originally posted on jforum.net by VVD]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not currently supported!

If you delete users, what happens to all their messages? They would all be orphaned unless the UID of the posts gets set to some generic, non-deletable user.
[originally posted on jforum.net by GatorBait3]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good system already used in others forums is to have 2 users (anonymous & killed) then assign posts to them before remove the user
[originally posted on jforum.net by redhand]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

redhand wrote:A good system already used in others forums is to have 2 users (anonymous & killed) then assign posts to them before remove the user


Exactly right redhand, this would work just fine.

I guess you would also have to dump their Privates Messages info too (sent, received, saved, etc.). to keep junk from accumulating in the DB.

A point to make here is that there is much more to deleting a user than just removing them from the jforum_users table!
[originally posted on jforum.net by GatorBait3]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE jforum_posts SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_topics SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_attach SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_search_topics SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_vote_voters SET vote_user_id=$KILLED_ID WHERE vote_user_id=?
UPDATE jforum_privmsgs SET privmsgs_from_userid=$KILLED_ID WHERE privmsgs_from_userid=?

DELETE FROM jforum_user_groups WHERE user_id=?
DELETE FROM jforum_topics_watch WHERE user_id=?
DELETE FROM jforum_forums_watch WHERE user_id=?
DELETE FROM jforum_banlist WHERE user_id=?
DELETE FROM jforum_bookmarks WHERE user_id=?
DELETE FROM jforum_sessions WHERE session_user_id=?
DELETE FROM jforum_privmsgs WHERE privmsgs_to_userid=?

[originally posted on jforum.net by VVD]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

VVD wrote:UPDATE jforum_posts SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_topics SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_attach SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_search_topics SET user_id=$KILLED_ID WHERE user_id=?
UPDATE jforum_vote_voters SET vote_user_id=$KILLED_ID WHERE vote_user_id=?
UPDATE jforum_privmsgs SET privmsgs_from_userid=$KILLED_ID WHERE privmsgs_from_userid=?

DELETE FROM jforum_user_groups WHERE user_id=?
DELETE FROM jforum_topics_watch WHERE user_id=?
DELETE FROM jforum_forums_watch WHERE user_id=?
DELETE FROM jforum_banlist WHERE user_id=?
DELETE FROM jforum_bookmarks WHERE user_id=?
DELETE FROM jforum_sessions WHERE session_user_id=?
DELETE FROM jforum_privmsgs WHERE privmsgs_to_userid=?



Looks good! Now all you have to do is modify the JForum code to add the delete feature! ;)

[originally posted on jforum.net by GatorBait3]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!