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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DotNetNuke 5.1 User Accounts Not Actually Deleted?DotNetNuke 5.1 User Accounts Not Actually Deleted?
Previous
 
Next
New Post
7/30/2009 8:09 PM
 

AFAIR there have been issues logged in Gemini to add features for "undeleting" a user, recycle a user and hard deleting - although I am not sure atm, if it has already been implemented for DNN 5.1.1


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
7/30/2009 8:38 PM
 

cathal connolly wrote
 

you should never do direct database access of dotnetnuke core tables in your modules, it's simply too dangerous. If we alter schema, or functionality of these, your modules may not work correctly. You should instead use the DotNetNuke API as it will always be in sync with any changes.

Cathal

I understand your point about relying on the API, but that is not what I am talking about.  I am not deleting Users in my own code, I am using the DNN UI to do that.

What I am referring to is that there are hundreds of third party modules that use 'UserID' as a foreign key to the Users table and have referential integrity imposed by the database to ensure that when a User is deleted from the table, the User's related data in the third party module is also deleted. 

For example,

SELECT  * 
FROM myCustomers
WHERE myCustomers.UserID=UserID (passed in from Context)

This recent change is a MAJOR change in behavior.  It is made worse by the fact that there is no way to force to the old behavior (direct hard delete).   It is further made worse by the fact that there no way to even clear out soft deletes, or even restore a soft deleted user.  What is point of having a soft delete without functionality to reverse the soft delete? The soft delete functionality is a nice thought but it is not very useful without this basic level of functionality and should not have been rolled out until the full functionality set (restore soft delete, clear soft delete, etc) was complete.

As for third party modules, what do you suggest?  Unless there is a hard delete on that record, there is no way for the module business logic to know that the User is 'deleted' without changing ALL of the third party modules SQL to now also check the IsDeleted flag in UserPortals before pulling their module data.

For example,

SELECT * 
FROM myCustomers
WHERE myCustomers.UserID = UserID (passed in from Context)
AND myCustomers.UserID = PortalUsers.UserID  (new)
AND PortalUsers.PortalID = PortalID    (new)
AND PortalUsers.IsDeleted = false (new)

See the problem?  This is a breaking change for hundreds of third party modules and it is not realistic to expect them all to make changes to their SQL to support this change.
 

 
New Post
7/30/2009 9:40 PM
 

Jay Mathis wrote
 

As for third party modules, what do you suggest?  Unless there is a hard delete on that record, there is no way for the module business logic to know that the User is 'deleted' without changing ALL of the third party modules SQL to now also check the IsDeleted flag in UserPortals before pulling their module data.

Jay Mathis wrote

See the problem?  This is a breaking change for hundreds of third party modules and it is not realistic to expect them all to make changes to their SQL to support this change. 

DotNetNuke runs on a "provider pattern" meaning you cannot assume that DotNetNuke is running on Microsoft SQL. A LOT of people run DotNetNuke on Oracle.

So any module developers who have created foreign keys that connect to Core Microsoft SQL tables have "hooked into" a "data provider". So these module developers have simply made a mistake. I can think of no documentation that ever indicated that this was supported or recommended. For example this tutorial: Recursive Drop Down List  says (...you would not make a module that accesses the DotNetNuke core tables directly because they could change. The core table is only used for demonstration) .

The tables in the DotNetNuke Microsoft SQL data provider change frequently. The fact that the Users table hasn't changed much is just by chance. So any module developer who feels this is a "surprise" only has to look at each of the .sql upgrade scripts for each version of DotNetNuke to see this fact.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
7/30/2009 10:09 PM
 

While I agree that modules should not directly access core tables outside of public API methods nor create foreign key relationships on core tables as a general rule, one case that requires a foreign key relationship/cascade deletes is that of ModuleID. At the moment, there is still no other way by which data for a particular module instance can be deleted upon removal of a deleted module from the recycle bin. Reluctantly, I include creation of a FK relationship on UserID back to the DNN Users table in those few situations for which no API option currently exists. Even adding an IsDeleted flag check to a module's SQL scripts still ties into a particular data provider.

Ideally, what we need are additional interfaces/events that a module can implement to be notified when a module is deleted (from a page or from recycle bin), when a user is created/deleted (soft or hard), etc.

I also question how many modules - core or third party - actually have had dataproviders other than for MS SQL written for them.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
7/30/2009 10:27 PM
 

AFAIk the only option to avoid FKs is to add triffers - opening other pitfalls. I agree, that the best option would be an interface (event) as business layer API (which would even support different stores being used by core and module). 


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DotNetNuke 5.1 User Accounts Not Actually Deleted?DotNetNuke 5.1 User Accounts Not Actually Deleted?


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