en-CAfr-CA

Fixing duplicate Display Names in DotNetNuke

Oct 19 2014

Since DotNetNuke 6, it is possible to require unique display names. This allows social modules to display a name for a user without exposing the login UserName or the real person first and last names. If you site uses social features, it is important that those display names be unique to prevent a user to post content in the name of another user.

By activating this feature, users are no longer able to register with a Display Name already in use. However, there are 2 oversights. First, the user or an admin can change the Display Name after registration to anything else (including a Display Name already in use). Secondly, you may already have duplicates before you activate this feature, and they don't get automatically changed. In this blog post, I provide you with both solutions the these problems.

Prerequisites

BACKUP YOUR WEBSITE FILES AND DATABASE!
This procedure has only been tested on DotNetNuke 7.3.3, so I recommend you first upgrade to this version. If you feel like trying it out on other versions, feel free to do it and post your results in the comments, but make sure you do that backup first.

1. Activating the feature

First, we will activate the feature requiring unique display names.

  1. Connect to your website as an administrator
  2. Navigate to Admin -> Site Settings
  3. Click the User Account Settings tab
  4. In the Registration Settings section, tick Require Unique Display Name
  5. Click the Update button at the bottom

Now, it will be impossible for user to register using a Display Name already used by another user.

2. Correcting the problem

I created a patch or DotNetNuke 7.3.3 that will prevent users and admins to change the Display Name to something already in use. Like I said before, this is for DotNetNuke 7.3.3, feel free to test and comment on other versions, but make sure you have backup. I submitted a the bog repport DNN-5874 and patch (pull request 160 now pull request 177) to DotNetNuke and I hope it will be applied to DotNetNuke 7.3.4. I will update this blog post when it is done. Update 10/21/2014: DotNetNuke has merged the pull request which means it should be part of 7.3.4. 2014-10-24: They have refused pull request 160 and I submited a new pull reques, I am still not sure if it will be merged to 7.3.4 or 7.4.0.

  1. Upgrade DotNetNuke to version 7.3.3 (or try with another version and report in the comments)
  2. Download the file PatchDNN-5874.zip
  3. Extract that file to your root DotNetNuke folder overwriting the files
  4. (optional, if you site has other languges):
    1. Go to Admin -> Languages
    2. Translate those keys:

      File Key
      DesktopModules/Admin/Security/App_LocalResources/EditUser.ascx.resx DisplayNameNotUnique.Text
      DesktopModules/Admin/Security/App_LocalResources/User.ascx.resx
      DisplayNameNotUnique.Text

We have now resolved this issue allowing users to change their display name to another one in use.

3. Fixing existing duplicates

Now that the issue is resolved for the future, we need to resolve it for the past. Your site may already have duplicate display names before this patch. In order to solve that, I have created a small module that will display all duplicates and allow you to change them in batch by clicking a single button, it will append the UserID to the display name to all users except the first that registered with that display name.

  1. Download the file DuplicateDisplayNamesFix_00.00.01_Install.zip
    The source package is also available if you are a developer DuplicateDisplayNamesFix_00.00.01_Source.zip
  2. Install it like any other module (Host -> Extensions -> Install Extension Wizard
  3. Create a temporary page that is only visible by administrators (or use an existing admin page)
  4. Place the Duplicte Display Names Fix module on that page
  5. The module will display a list of all users with duplicate display names or a message if none are present
  6. You can export the list to Excel or CSV if you want to keep that information for your records (to send them an email for example)
  7. Now you can click the GO button to rename them.
    (this operation cannot be undone, make sure you have that backup.)
  8. If you don't think to use the module again you can now uninstall it and delete the temporary page

All questions and comments are welcome.

Total: 2 Comment(s)
Daniel Valadas
Daniel Valadas  Update: DotNetNuke has accepted the pull request so it should be include in 7.3.4
· reply ·
Daniel Valadas
Daniel Valadas  Pull request 160 has been refused because I used the Github editor to make some minor modifications and it marked all lines changed because of the line endings that are different on windows and linux. I submitted a new pull request #177 but I am still not sure if it will be merge to Dnn 7.3.4 or 7.4.0
· reply ·

Author

Daniel Valadas 12508 9

Calendar

2018 Jul  11  1
2018 Jun  26  1
2018 May  46  1
2014 Oct  2583  3
2014 Jun  4931  1
2014 Feb  3433  1
2012 Mar  1478  1

Recent Posts

Core modules development team first meeting recording
2018-07-06 12:53 PM | Daniel Valadas
Removing Roadblocks to Upgrading By Reviving the Old Core Modules
2018-06-25 4:23 PM | Daniel Valadas
How to secure a whole Dnn site with an SSL certificate
2018-05-08 4:51 PM | Daniel Valadas
Take a list of emails and separate them with a semi-colon (;)
2014-10-24 5:14 AM | Daniel Valadas
Fix: DotNetNuke users can't reset their password
2014-10-24 3:21 AM | Daniel Valadas
Fixing duplicate Display Names in DotNetNuke
2014-10-19 11:17 PM | Daniel Valadas
Creating a webservice in DotNetNuke 7
2014-06-11 1:02 PM | Daniel Valadas
How to move a DotNetNuke Website to another server
2014-02-10 10:51 AM | Daniel Valadas
World Backup Day
2012-03-31 1:28 PM | Daniel Valadas