Products

Solutions

Resources

Partners

Community

About

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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepository"Author" field = free field ???"Author" field = free field ???
Previous
 
Next
New Post
3/2/2007 12:59 PM
 

ok, so if I understand your requirements ..

During an 'Edit', the authorname and authoremail fields should retain their original values and not be replaced by the person who is logged in and editing the entry

I would again change the CreateInputForm function in Form.ascx.vb, find the case statements where the AUTHORNAME and AUTHOREMAIL tags are processed. I would modify the logic slightly to only set the fields to the logged in user if the Repository item's ItemID field is equal to -1, which indicates the item is being added. That way on an 'edit' the original author's name and email will not be changed. (add the text in blue below)

If objRepository.ItemID = -1 And HttpContext.Current.User.Identity.IsAuthenticated Then
  objTextbox.Text = UserInfo.Profile.FullName
  ' objtextbox.Enabled = False
End If

 

 
New Post
3/2/2007 1:35 PM
 

Ok, I have figured this out.

Steve had suggested the following modification:

If HttpContext.Current.User.Identity.IsAuthenticated Then
  objTextbox.Text = UserInfo.Profile.FullName
  ' objtextbox.Enabled = False
End If

Try this instead:

If HttpContext.Current.User.Identity.IsAuthenticated And objRepository.ItemId > 0 Then
  ' objTextbox.Text = UserInfo.Profile.FullName
  ' objtextbox.Enabled = False
ElseIf HttpContext.Current.User.Identity.IsAuthenticated Then
  objTextbox.Text = UserInfo.Profile.FullName
  objtextbox.Enabled = False
End If

This adds an additional check to see if the object is a New Item, If it is not, then it will allow the Author and Email values to be edited, showing the current value. If the object is a New Item, then it uses the logged in User's Profile to fill in the Author and Email fields, which can not be edited.

Don't forget to apply the same modifications to the EMail section as Steve mentioned in his post.

 



Gary
 
New Post
3/2/2007 1:44 PM
 

Hehe, I guess Steve had posted while i was posting ... and talking on the phone!!

Thanks Steve



Gary
 
New Post
3/3/2007 1:09 AM
 

Thanks guy, my friend send me a gift this morning, the file modified as expected !!
i.e. :
- if it is a new item, it takes the username/email of logged user with possibility to modify it.
- if it is an old item, it takes the existing value.

Just perfect as I expected !!!! I am very happy, I will work with it. If someone need the modification, I will ask my friend if he agrees to give it (and I will put it on my web).

DV

 
New Post
6/9/2007 4:01 AM
 

Hello,

Are these modifications included into the new Repository 03.01.12 ???
DV FX

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepository"Author" field = free field ???"Author" field = free field ???


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