Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedDelete user from codeDelete user from code
Previous
 
Next
New Post
1/9/2010 12:55 PM
 

Hi all,

I'm using dnn community ed. ver 5.x.I'm trying to delete an user account from C# code with:

DotNetNuke.Entities.Users.UserInfo objUserInfo = DotNetNuke.Entities.Users.UserController.GetUser(0, userid, false);

UserController.DeleteUser(ref objUserInfo, false, false)

 

where userid is known. It deletes from the tables aspnet_*, but not from the "Users" table.. what should I call to completely remove the user?

 

Thanks,

Lucian

 
New Post
1/9/2010 5:47 PM
 

What you are finding is actually the same result that would be obtained when "deleting" a user using the Admin-->User Accounts interface. DNN 5.x "soft" deletes a user by removing its entry from the aspnet_Membership table (but as I recall leaving the entry in the aspnet_Users table), deleting its roles and permissions, AND setting the IsDeleted column of its entry in the UserPortals table to true. The user's entry in the Users table is NOT deleted.

Soft deletion of users has both advantages and disadvantages, proponents and opponents.

As far as I know, there is no administrative or host interface nor API nor database stored proceedure in the most recent framework version (5.02.01) to completely remove the user. It is my understanding that this will be provided in a future version. Until then, you're on your own if you wish to completely remove the user.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/10/2010 8:15 AM
 

I feared of such an asnwer... anyway, thank you.

Lucian

 
New Post
5/4/2010 5:11 AM
 
This doesn't seem to be correct - the user remains in aspnet_Membership and resetting the flag in the UserPortals table brings the user back to life. JC
 
New Post
9/4/2010 3:21 PM
 
John Cant Thanks for your post. It allowed me to reinstate a user that was inadvertently deleted. Further to this, the UserRoles records for the user are hard deleted. So if you reset the UserPortals IsDeleted Flag, you then have to reassign the roles to the user. The IsDeleted flag in the Users table is left at False when a user is (soft) deleted, which seems to be a bit hokey. All the best Dave
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedDelete user from codeDelete user from code


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out