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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsHelpHelpHow Can I Delete a User who Registered with an Asterisk in Username?How Can I Delete a User who Registered with an Asterisk in Username?
Previous
 
Next
New Post
2/9/2006 9:12 AM
 
We are currently allowing students to register at the login page, and then I go in and Authorize them.  Last night, a student registered and put an * in her username, and now I get a Critical Error when I try to pull up Page 8 of my user list because that is the page she is on.  I can't figure out how I can either edit her username to remove the asterisk or delete her altogether (hopefully retrieving her email address first so that I can email her and tell her to pick a different username with no asterisk this time). 
 
New Post
2/9/2006 8:17 PM
 

Greetings...

If you have access to SQL Query Analyzer, this script will update her userid for you ( you'll have to notify her of the change ).  Note that this SQL handles the DNN forums too... if you don't use them, take this bit out ( highlighted ).

This should not cause an error... and should be considered a bug, in my estimation.  Please feel free to log this problem at http://support.dotnetnuke.com.  We appreciate your help.

Cheers


DECLARE @OldUsername varchar(50)
 DECLARE @NewUsername varchar(50)
 SET @OldUsername='enter old username here'
 SET @NewUsername='enter new username here'

BEGIN TRAN
 update aspnet_users
 set UserName = @NewUsername, LoweredUsername=lower(@NewUsername)
 where lower(UserName)=lower(@OldUsername)
 IF @@ROWCOUNT=0
  PRINT 'User ' + @OldUsername + ' not found in aspnet_users table.'
 ELSE
  PRINT 'User ' + @OldUsername + ' changed to ' + @NewUsername + ' in aspnet_users table.'
 update users
 set Username = @NewUsername
 where lower(UserName)=lower(@OldUsername)
 IF @@ROWCOUNT=0
  PRINT 'User ' + @OldUsername + ' not found in users table.'
 ELSE
  PRINT 'User ' + @OldUsername + ' changed to ' + @NewUsername + ' in users table.'
 update forum_users
 set alias=@NewUsername
 where lower(alias)=lower(@OldUsername)
 IF @@ROWCOUNT=0
  PRINT 'User ' + @OldUsername + ' not found in forum_users table.'
 ELSE
  PRINT 'User ' + @OldUsername + ' changed to ' + @NewUsername + ' in forum_users table.'
If @@ERROR=0
 BEGIN
  COMMIT TRAN
  PRINT 'username change committed'
 END
ELSE
 BEGIN
  ROLLBACK TRAN
  PRINT 'username change rolled back'
 END
GO


Scott Willhite, Co-Founder DNN

"It is only with the heart that one can see rightly... what is essential is invisible to the eye. "
~ Antoine de Saint-Exupéry

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsHelpHelpHow Can I Delete a User who Registered with an Asterisk in Username?How Can I Delete a User who Registered with an Asterisk in Username?


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