YAFLogo

Rawbert
  • Rawbert
  • 94.2% (Exalted)
  • YAF Commander Topic Starter
10 years ago
I had some spam registrations on one of my forums, about 15 accounts, so I deleted them all from within DNN, Admin> User accounts. Now when I try to delete them from YAF I get an error. That's when I realized I should've probably deleted them from YAF first..

So how do I get rid of them now?

I just delete a whole row where the user's name is in the sql table dbo.yaf_User?

Why some of the users are in a different table? Namely in dbo.yaf_UserProfile.

What's the best practice to delete users? First YAF then DNN? Does the user importer play any role in this?

It'd be nice to be able to delete in one shot.

Sorry if my questions are silly but I don't have too much experience with YAF.

Sponsor
Rawbert
  • Rawbert
  • 94.2% (Exalted)
  • YAF Commander Topic Starter
9 years ago
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 years ago
I didn't forget about that questions. But i have to figure out a solution to that problem first.

The goal is that you only have to delete the user in dnn only. And yaf detects when the user was deleted and then automatically also deletes the user in yaf.

I will update this topic as soon as I have a solution.

Rawbert
  • Rawbert
  • 94.2% (Exalted)
  • YAF Commander Topic Starter
9 years ago
Great, thanks Watcha!

It'll remove the old ones too that's been deleted before or those need to be removed manually?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
9 years ago

Great, thanks Watcha!

It'll remove the old ones too that's been deleted before or those need to be removed manually?

Originally Posted by: Rawbert 

Ok i have a solution now, as it turns out you can't delete it in one place an then in the other, it will never work.

However i uploaded a new build 5608...

https://github.com/YAFNET/YAFNET-DNN/releases/tag/v2.1.2-5608 

- soft deleting of user will unapprove them in yaf, and if you restore the account the user gets approved again

- hard deleting of a user in dnn will automatically delete the user in yaf

- deleting user from yaf is disabled always use dnn to delete a user.

Ok and to remove the remaining users from yaf which you have already deleted in yaf you have to run the following sql manually for each user

DECLARE @YafUserID int

SELECT @YafUserID = UserID FROM [{databaseOwner}].[{objectQualifier}User] WHERE Name = 'ENTERUSERNAMEHERE'

EXEC [{databaseOwner}].[{objectQualifier}user_delete] @YafUserID

Replace "ENTERUSERNAMEHERE" with the actually username you wish to delete

Rawbert
  • Rawbert
  • 94.2% (Exalted)
  • YAF Commander Topic Starter
9 years ago
Awesome, thank you Watcha!!