August 01, 2007

Fixing Lockout Due to Profile Property Requirement

One problem I recently encountered myself is one that I see appearing every so often on the DotNetNuke forums. I was working with profile properties and I set a property as required but accidentally forgot to set it to visible. I then proceeded to update the preferences that require a valid profile for login. I am now effectivly locked out of my site as I did not have that property set for my host or admin account. In this article I will provide you the information needed to reset the custom properties and to get you back into your site.


As I provide the needed SQL Queries I am going to assume that you are working with a portal that has the id of 0 if you are working with a portal other than portal 0 you will need to modify all applicable scripts to ensure that you modify the proper data values.

Also please note that you are using these queries at your own risk and that I am not liable for any data loss that might occur.

Gather Information

Before we execute the update script we should run the below script. This will identify the profile properties that we will be modifying when we perform the actual fix for this issue.

SELECT PropertyName,
FROM profilepropertydefinition
WHERE PortalId 0
AND Deleted 0
AND Required 1
AND Visible 0

In this query we are simply looking for any profile properties that are marked as required, are not visible, and exist in our current portal. This query will show you ALL properties that will be updated with the "Fix" script that will follow later in this article.

Perform the Fix

The process of fixing this issue is very simple, I personally prefer to simply update the visibility on the newly required fields to ensure that they will show. You have other options as well but I see this as the least involved method and the least likely to affect other areas of the site. As long as all information looked ok from the "Gather Information" step you may execute the below script to fix the records.

UPDATE Profilepropertydefinition
SET Visible 1
WHERE PortalId 0
AND Deleted 0
AND Required 1
AND Visible 0

Now that you have ran this script you should be able to login and provide the needed profile elements. If you are still unable to see the fields, you will need to trigger an application restart. This can be done by adding a space to a non-critical portion of your web.config and saving the change.

I hope this article has been able to help you get back into your portal if you were locked out. Please share you comments and concerns below.

tags: DNN, Tutorials, SQL
comments powered by Disqus

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.