More in this section

Forums / Developing with Sitefinity / Author Name Changes in Forum Module

Author Name Changes in Forum Module

12 posts, 0 answered
  1. Martin
    Martin avatar
    10 posts
    Registered:
    09 Jan 2008
    08 May 2008
    Link to this post
    We noticed that when logged-in the names of those posting appears as the person logged in, while when we use anonymous access the names of those who posted to the thread is correct.

    Not logged in, works great:
    http://www.conferenceboard.ca/documents/dev/anon-access.gif

    Logged in, the post's author's name changes to the user logged in:
    http://www.conferenceboard.ca/documents/dev/signed-in.gif

    Any ideas about this, we are stuck!

    Martin
  2. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    12 May 2008
    Link to this post
    Hi Martin,

    By design, when a user does not have specified First and Last name, the forum control displays as author name the name of the user who posts. This means that the issue could appear no matter if the user is anonymous or no. A workaround for this is to modify the following files:

    1) SingleThread.ascx stored at ~/YourProject/Sitefinity/ControlTemplates/Forums/SingleThread.ascx
    <prof:ManageProfile ID="userProfile" UsernameIfNoNames="false" runat="server"
            <ViewTemplate> 
                <asp:Literal ID="FirstName" runat="server"></asp:Literal>&nbsp; 
                <asp:Literal ID="LastName" runat="Server"></asp:Literal> 
     
            </ViewTemplate> 
        </prof:ManageProfile> 
    The highlighted attribute should be added as the default value is "true".

    2) SingleForum.ascx stored at ~/YourProject/Sitefinity/ControlTemplates/Forums/SingleForum.ascx
                        <prof:ManageProfile ID="lastPostAuthor" UsernameIfNoNames="false" runat="server"
                            <ViewTemplate> 
                                <asp:Label ID="FirstName" runat="Server"></asp:Label>&nbsp; 
                                <asp:Label ID="LastName" runat="Server"></asp:Label> 
                            </ViewTemplate> 
                        </prof:ManageProfile> 

    Hope that this information is helpful.

    Regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Martin
    Martin avatar
    10 posts
    Registered:
    09 Jan 2008
    12 May 2008
    Link to this post
    Just to clarify.

    All users will be logged in to view and edit the posts to the forum. Right now this is not the case however.

    So, when users post to the forum it shows their name as the poster of all of the posts even if they were not the ones to actually post anything.

    You can see this in the links I provided below. When signed in "Martin Braithwaite" appears as the author of all of the posts (even showing 4 comments and 2 comments below). When viewing the forum without being signed in, anonymously, we can see that the name on the left work and accurately show who posted the information and how many posts they have.

    The question is, why is this? We made the changes you suggested below but this just removed ALL names from the author area.

    We are not sure if this is abug or not, but we just want the simple functionality of knowing who posted each post--as you have it configured on the sitefinity forums.
  4. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    14 May 2008
    Link to this post
    Hi Martin,

    Unfortunately, we were unable to reproduce the reported behavior. We created the same scenario using the Forums control but neither wrong poster names nor problems with logged users were observed. The names appear as set in the users profiles. Can you please check if you are using the Forums control; also check if there is something specific in the role permissions of Martin Braithwaite?

    Thank you for your cooperation.

    Regards,
    Nikifor
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Martin
    Martin avatar
    10 posts
    Registered:
    09 Jan 2008
    14 May 2008
    Link to this post

    Thanks for you help!

    We've implemented a custom profile provider and would like to know which method from the ProfileManager (http://msdn.microsoft.com/en-us/library/system.web.profile.profilemanager_methods(VS.85).aspx) Sitefinity is using.

    The following profile properties are currently in our Web.config:

    <profile defaultProvider="CisMembershipProvider">

    <providers>

    <clear/>

    <add name="CisMembershipProvider" type="Cboc.Website2005.SecuritySystem.CisProfileProvider" connectionString="Website2005Db"/>

    </providers>

    <properties>

    <add name="ID" type="String" allowAnonymous="true" defaultValue="" provider="CisMembershipProvider"/>

    <add name="Email" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Prefix" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="FirstName" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="MiddleName" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="LastName" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Gender" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="JobTitle" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Organization" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="FullAddress" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Address1" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Address2" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="City" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Region" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="Country" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="PostalCode" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="PhoneNumber" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="FaxNumber" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingFullAddress" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingAddress1" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingAddress2" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingCity" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingRegion" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingCountry" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingPostalCode" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingPhoneNumber" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="BillingFaxNumber" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="JobType" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="MajorJobFunction" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="AreasOfInterest" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="LearningStyle" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="DietaryRestrictions" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    <add name="OrgId" type="String" allowAnonymous="true" provider="CisMembershipProvider" />

    </properties>

  6. Nikifor
    Nikifor avatar
    232 posts
    Registered:
    18 May 2013
    17 May 2008
    Link to this post
    Hello Martin,

    Our profile provider recreates the System.Web.Profile.SqlProfileProvider class, the only difference is that we are using Nolics. As for the ProfileManager methods, we have implemented the whole profile functionality, except the methods: DeleteInactiveProfiles, GetAllInactiveProfiles, FindInactiveProfilesByUserName and GetNumberOfInActiveProfiles.


    Hope this helps.

    All the best,

    Nikifor
    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
  7. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    21 May 2008
    Link to this post
    Very weird.  Its something with our custom provider...but this provider is working fine with our existing app.  Does anything else need to be changed when you're using a custom ProfileProvider?  I noticed your can set the profileProviderName for forums in the Web.config.  I've made this change, but this has had no effect.

    <forums defaultProvider="Sitefinity">

    <providers>

    <clear/>

    <add name="Sitefinity" securityProviderName="" profileProviderName="Sitefinity" type="Telerik.Forums.Data.DefaultProvider, Telerik.Forums.Data" connectionStringName="DefaultConnection" visible="true"/>

    </providers>

    </forums>


    Thanks again for your help!
    J (Responding on behalf of Martin)
  8. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    26 May 2008
    Link to this post
    A couple other questions:

    1)  Which method in the ProfileProvider do you use to determine FirstName and LastName?  Is it FindProfilesByUserName?  Can I get a copy of the Sitefinity ProfileProvider so I can compre this with mine?

    2) How can we simulate an anonymous user on our forum?  In our case the forum displays properly for anonymous users, but I can't see the code behind to look at the login.  Is there a way to see this?

    Thanks again for your help.  We'd really like to solve this ASAP as its the FINAL piece we need to sort out before we launch our CMS.

    J
  9. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    27 May 2008
    Link to this post
    Hi Jason M,

    Unfortunately, the profile provider cannot be changed for Forums only, but instead you can indicate which Profile property is handled by which provider. This is how ASP.NET works. For each property declaration in web.config, you can add the provider attribute indicating the name of the provider you have added. This is how to do it:
    <profile defaultProvider="Sitefinity"
          <providers> 
            <clear/> 
            <add name="Sitefinity" connectionStringName="DefaultConnection" applicationName="/" type="Telerik.DataAccess.AspnetProviders.TelerikProfileProvider, Telerik.DataAccess"/> 
            <add name="test" connectionStringName="DefaultConnection" applicationName="/" type="TestProfileProvider"/> 
          </providers> 
          <properties> 
            <add name="FirstName" provider="test"/> 
            <add name="LastName"/> 
          </properties> 
        </profile> 

    In this case, the FirstName property can be handled by provider Test, and LastName by the default one, which is Sitefinity. As for the method you need in your implementation, it is GetPropertyValues. It is the one called by the ManageProfile control used in Forums, and you have to implement it anyway, because it is present in the abstract System.Web.Profile.ProfileProvider class that you have to inherit. You can find more info on how to implement the method here: http://msdn.microsoft.com/en-us/library/0580x1f5.aspx.

    I am not sure what you mean by "simulate an anonymous user", so could you please give some more details, what codebehind do you need?

    Regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    28 May 2008
    Link to this post
    Hello Slavo,

  11. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    28 May 2008
    Link to this post
    Hello Slavo,
     
    To recap the issue:
    When an authenticated user is on a forum thread the post author's name changes to the logged in user (example: http://www.conferenceboard.ca/documents/dev/signed-in.gif).  However, anonymous users see the post author's name correctly (example: http://www.conferenceboard.ca/documents/dev/anon-access.gif).
     
    1)  Membership, role and profile provider solution:  We've implemented custom profile, members and role providers.  Our current implementation uses the MSDN documentation and works fine for all other aspects of site.  I'd like to compare Sitefinity's implementation to our own since there must be some "disconnect" causing this.
     
    2)  Possible workaround:  With regards to "simulating an anonymous user".  What code decides the post author's display name on the SingleThread.ascx control?  There must be some logic that sets different post author name for anonymous and authenticated users.
     
     
    Thanks again for your help!
    J
  12. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    02 Jun 2008
    Link to this post
    Hello Jason,

    We have opened a support ticket and replied to your issue there. Please see the ticket about Sitefinity profile provider.

    Kind regards,
    Slavo
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
12 posts, 0 answered