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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Error Deleting UserError Deleting User
Previous
 
Next
New Post
1/5/2008 5:39 PM
 
I have dnn 4.6 

I'm trying to delete users on the User Accounts page when I click on the red X for the user I want to delete I get an message "Error Deleting User" and the user remains. There is no entry made in the log file and no more detail provided.

I have read the same problem in this link: http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/108/threadid/46495/scope/posts/Default.aspx

and I have used this sql script with no result:

 

DECLARE @IUserID INT

SELECT @IUserID = UserID FROM USERS WHERE UserName = 'user name'
DELETE FROM USERPORTALS WHERE UserId = @IUserID
DELETE FROM USERROLES WHERE UserId = @IUserID
DELETE FROM USERSONLINE WHERE UserId = @IUserID
DELETE FROM PROFILE WHERE UserId = @IUserID

I have found another scipt to use but I am a newbie and I'm not able to use it:

CREATE procedure [dbo].[sp_DeleteUser_WithDependancies]
(
@UserName varchar(50)
)
as
begin

BEGIN TRAN

declare @UserId int
declare @AspNetId varchar(50)

set @UserId = (select UserId from users where username = @UserName)
set @AspNetId = (select UserId from AspNet_Users where username = @UserName)

print 'Deleting UserId:'+cast(@UserId as varchar(20))+' Guid:'+@AspNetId

delete from userroles where userid = @UserId
delete from dbo.aspnet_Membership where userid = @aspnetid
delete from dbo.aspnet_Profile where userid = @aspnetid
delete from dbo.aspnet_UsersInRoles where userid = @aspnetId
delete from dbo.Profile where userid = @userId
delete from dbo.UserBackup where userid = @userId
delete from dbo.UserPortals where userid = @UserId
delete from dbo.UserRoles where userid = @userid
delete from dbo.UsersOnline where userid = @userid
delete from aspnet_users where username = @username
delete from users where userid = @UserId

COMMIT TRAN

end

I'd like to try this script. can you help me to use in sql shell of dnn?

 
New Post
1/5/2008 6:22 PM
 

Shawn,

You should be able to run the script that you pasted (the "create procedure sp_DeleteUser_WithDependencies" script) -- this will create the stored procedure in your database.

Now that the stored procedure exists, you can execute it with the following:

exec sp_DeleteUser_WithDependencies 'usernamehere'

assuming that this stored procedure does what you want it do (looks like it should...) -- that should take care of your issue :)

hope that helps,

Ian

 


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
1/5/2008 7:58 PM
 

It is better to just remove the authorization flag but keep the user indefinitely. 

There are so many dependancies that you will always have difficulty deleting users properly.
Your store procedure won't work because it does not cover all tables that need cleaning.

 

 
New Post
1/5/2008 8:08 PM
 

eck two wrote

It is better to just remove the authorization flag but keep the user indefinitely. 

please pay attention, if you are using verified registration, the user might re-authorize by entering the verification code. To prevent him from doing so, you should also alter the email address and the password.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/4/2008 2:55 PM
 

VERSION 4.7

This is the third time I have had this problem. I have 2 users who were editing their page. A error occured ( of course they could not remember ) . Then all of their normal view rights were gone. They could not see any content in any page but they could see the containers. When I went in as admin and tried to delete them I get "Error Deleting user. And the user is not DELETED. I though after the first one it was nothing to worry about, Now I have had 2 more in the past 2 days. Something while their page edits are saving is corrupting the user tables somewhere. Not versed enough to find the actual table corrupted

 

Any IDEAS

 

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Error Deleting UserError Deleting User


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