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.

Assumptions

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,
        PropertyCategory
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.

Posted by Mitchel on Wednesday, August 01, 2007
 

Comments

Where do you go to edit the file on the backend of the site?

By Nadine on Wednesday, September 12, 2007 at 7:37 AM

This must be executed on the SQL Server directly.

You can use SQL Server Management Studio Express, Enterprise Manager or other SQL utilities to execute the statement.

By mitchel.sellers@gmail.com on Wednesday, September 12, 2007 at 10:15 AM

I am all very new to this and I am learning alot. This topic is helping me alot. I downloaded the required program and connected to my site. I then try to run the script:
SELECT PropertyName,
PropertyCategory
FROM profilepropertydefinition
WHERE PortalId = 0
AND Deleted = 0
AND Required = 1
AND Visible = 0
I get an error when I run the script stating [Invalid object name 'profilepropertydefinition'.] What should that be changed to?

By Nadine on Wednesday, September 12, 2007 at 7:41 PM

If you specified an object qualifier you must add that before the name of the table.

so if you had an object qualifier of DNN_ then the name would be changed to DNN_profilepropertydefinition

By mitchel.sellers@gmail.com on Thursday, September 13, 2007 at 3:32 AM

Thank you so much! You are a genuis!

By Nadine on Friday, September 14, 2007 at 5:13 AM
Click here to post a comment

Donate

Show your appreciation for the content/modules made available by MitchelSellers.com by making a donation. Donations are used to assist with dedicating time to creating free content.