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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How to handle auditing for particular user profile properties in DNN 7?How to handle auditing for particular user profile properties in DNN 7?
Previous
 
Next
New Post
4/27/2015 2:43 AM
 

Hello, 

I would like to save datetime value when a user modifies some of the profile properties for e.g. DateOfBirth. The main aim as per the nature of my app here is just to audit modification date and time for certain properties and not for the whole user profile entity. 

I've two options for audit purpose for these particular properties:

  1. To audit only the last modification date and time. For this, I've created a new user profile property and this is not visible to users on UI.
  2. To audit all of them. For this, I guess I'll have to create a new table in the database for audit purpose.

How can I hook this additional modification date time save feature in the database for both of the options above? As I need to know when a User modifies their user profile to save this additional information. Can I still reuse the Edit Profile feature available in DNN and save this information OR do I need to create a new module just to modify those profile properties for which I need to audit?

 

 
New Post
4/28/2015 1:48 AM
 
user Profile stores auditing info per property, though the values are not displayed on the UI.
And the Users module might not check, whether a value has changed, when hitting update, i.e. updating each property.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/29/2015 7:19 AM
 

Hi Sebastian, 

Thanks for pointing out the built-in property level auditing in UserProfile table.

I access this using: 

ModuleContext.PortalSettings.UserInfo.Profile.ProfileProperties.GetByName("FirstName").LastModifiedOnDate

In return what I see is the default datetime value that is "1/1/0001 12:00:00 AM". Although I can see the actual correct value in the database. I use the above statement in my custom module that inherits "ModuleUserControlBase". 

Is this something you told me already that it may not check whether a value has changed ? when you mentioned: " the Users module might not check, whether a value has changed, when hitting update, i.e. updating each property."

Is there any other way to access the last updated datetime information? Or do I just need to just query the table manually with where clause including portal id, user id, etc. ?

 
New Post
4/29/2015 7:21 AM
 

Also, I forgot to add that I see the updated value for that property by using the same code but the LastModifiedOnDate property is set to DateTime default value.

 
New Post
4/29/2015 7:58 AM
 
Siddharth Pandey wrote:

Hi Sebastian, 

Thanks for pointing out the built-in property level auditing in UserProfile table.

I access this using: 

ModuleContext.PortalSettings.UserInfo.Profile.ProfileProperties.GetByName("FirstName").LastModifiedOnDate

In return what I see is the default datetime value that is "1/1/0001 12:00:00 AM". Although I can see the actual correct value in the database. I use the above statement in my custom module that inherits "ModuleUserControlBase". 

Is this something you told me already that it may not check whether a value has changed ? when you mentioned: " the Users module might not check, whether a value has changed, when hitting update, i.e. updating each property."

Is there any other way to access the last updated datetime information? Or do I just need to just query the table manually with where clause including portal id, user id, etc. ?

GetUserProfile retrieves property values with lastModifiedOnDate and lastModifiedByUser from UserProfile table in the database. If the value is properly stored but you are getting a null date, there must be an issue in DNN API.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How to handle auditing for particular user profile properties in DNN 7?How to handle auditing for particular user profile properties in DNN 7?


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