More in this section
Forums / Developing with Sitefinity / Securing blog comments

Securing blog comments

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Marco Tana
    Marco Tana avatar
    1 posts
    18 Jan 2005
    13 Mar 2008
    Link to this post
    Is there a way to force a user to sign-in/register first before he/she can comment on a blog?  I tried to see if there's a setting but there isn't one. 
  2. Tihomir
    Tihomir avatar
    53 posts
    24 Sep 2012
    14 Mar 2008
    Link to this post
    Hello Marco Tana,

    I am sorry but we currently do not provide this functionality out-of-the-box but it can be achieved by adding just a little custom code. You will need to extend one class - Telerik.Cms.Engine.WebControls.CommentsList. Here are some guidelines on how to do that with Sitefinity 3.2:

    1. In your CommentsList extender you will just need to add an event handler and subscribe to the submit button command in the CreateChildControls overridden method:

    this.Container.SubmitButton.Command += new CommandEventHandler(MySubmitButton_Command); 

    2. In this event handler you can check whether the user is authenticated:

    if (!this.Request.IsAuthenticated) 
       // this line will make the base event handler do nothing and skip the registration of the comment 
       this.ParentID = Guid.Empty;   

    3. You will need to modify the Blogs ContentViewSingleItem.ascx public control template to use your CommentsList extender instead of the old CommentsList custom control.

    Let us know how it goes!

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered