Search
  
 
Mitchel Sellers' DotNetNuke, .NET, and Other Topics BlogMinimize
 
 
Subscribe To Blog Updates by E-Mail

Current Articles | Categories | Search | Syndication

   
 Fixing Lockout Due to Profile Property Requirement
By Mitchel Sellers on Wednesday, August 01, 2007 @ 5:16 AM
 
  443 Views :: 5 Comments :: :: DotNetNuke, Tutorials, SQL
  
 

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.

 
  
 Share/Save This Article 
 

Use the below controls to save this article to one of many popular social bookmarking sites!

   kick it on DotNetKicks.com  
 
  
 Article Rating 
  
  
 Article Comments 
 
By Nadine @ Wednesday, September 12, 2007 7:37 AM
Where do you go to edit the file on the backend of the site?

By Mitchel Sellers @ Wednesday, September 12, 2007 10:15 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 Nadine @ Wednesday, September 12, 2007 7:41 PM
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 Mitchel Sellers @ Thursday, September 13, 2007 3:32 AM
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 Nadine @ Friday, September 14, 2007 5:13 AM
Thank you so much! You are a genuis!

Click here to post a comment
 

 Add to Technorati Favorites
 Print   
 
  
 
ArchiveMinimize
 
 
 Print   
 
  
 
CategoriesMinimize
 
 
 Print   
 
  
 
DonateMinimize
 
 

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. 

 Print