•  chrisgr
  • 67.4% (Friendly)
  • YAF Forumling Topic Starter
I was wondering if anyone has a solution on how to delete a user from the YAF db when they are deleted out of the aspnet_users table in the membership portion (using 2 different db's)? I have an option for users to delete their membership on their own and was wondering about anything left over in the YAF tables. Should I run a sproc nightly to rid the remnants, let em be, or what kind of problems I could encounter. If I run a sproc, I'll have to find all the foreign keys as in my testing, if there is a PM, it is relational to the user id.
I still have a BUNCH of ?'s but going to try to figure out what I can. Yaf rules!

Oh, does anyone know how I can reset my password here if I can't remember it and it doesn't accept the answer to my question? Either I wrote something down wrong, yaf issue or major brain freeze on mypart. I can't sign in at work and working on my cookie at home to get in. I don't want to logout at home and try to logon again as if I can't get back in, I'll be in meltdown!
  •  Mek
  • 100% (Exalted)
  • YAF Developer
Now thats a good question, 'cos in my opinion Sent Items should be left, and that'll require elements to be kept in order for the relationships to work, same with Posts made or anything thats publicable viewable created by that user.
I've never tested how it handled it to be honest as I let old users just float and don't delete them, though I may ban them.

If I find myself at a loose end, I'll run a few tests. Any particular reason/scenario where you are going to be regularly deleting users?


"It's a case of RTFM.. the only problem being we don't have a manual!"

When I post FP:Mek in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Ederon 🙂 )
  •  chrisgr
  • 67.4% (Friendly)
  • YAF Forumling Topic Starter
Thanks Mek! My site gives the user full control what does and does not post as well as deleting their profile in case they want to bailout. I'll run some what if's to see where it goes by leaving the Yaf portion of their profile. I'm wondering if their username will conflict with others in the PM portion. My side deletes all their footprints (except some IP stuff to go back on for CYA)
I don't plan on deleting users myself, however I give the user full control to do so. Yep, IP banning is in my adgenda.
Many thanks!!
The proc yaf_user_delete sets the username/lastusername column(s) of yaf_Mesage, yaf_Topic and yaf_Forum to the username, then sets the userId to a guest's userId, sets the fromUserId of PMs to the guest's userId, then deletes everything (messages, evetns, PMs, groups, etc.) associated with the user.

Basically, the only code that ends up calling this proc is when manually deleting users. I don't know if another proc calls this one or not - so maybe a proc that does some kind of sync calls it.

Be careful using the proc - it doesn't appear finished and currently (1.9.3-RC2) has the potential to crash the app or give undesired results.

not jsheLPer
  •  chrisgr
  • 67.4% (Friendly)
  • YAF Forumling Topic Starter
Thanks JS! You've given me some info to test on hopefully this w/e. I'm still plowing through all the elements of YAF and the learning curve is high. But like everything else, time and effort will make it clearer. I'm still in the development stage and always backup prior to doing anything 'dangerous'. I'll be sure to take this into consideraton.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved