Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carsten 13 posts 33 karma points
    Oct 26, 2011 @ 11:19
    Carsten
    0

    GetCurrentMember returns wrong node

    Hi there umbraco community,

    I've got a wired problem with the umbraco library function GetCurrentMember(): It returns the wrong member node.

    I'm handling user logins using the standard ASP.Net LogIn control. Here is my code from the template:

    <form runat="server">
        <asp:LoginView ID="LoginView" runat="server">
            <AnonymousTemplate>
                <asp:Login ID="Login" TitleText="Log In" FailureText="Login failed!" RememberMeText="Remember login" PasswordLabelText="Password:" UserNameLabelText="E-Mail:" runat="server"/>
                <asp:PasswordRecovery ID="PasswordRecovery" UserNameLabelText="Forgot E-Mail?" UserNameInstructionText="..." SubmitButtonText="Send me a new password" SubmitButtonType="Link" runat="server">
                    <MailDefinition From="..."  Subject="..."/>
                </asp:PasswordRecovery>
            </AnonymousTemplate>
            <LoggedInTemplate>
                <asp:LoginName ID="LoginName" runat="server" FormatString="Welcome, {0}"/>
                <asp:Hyperlink NavigateUrl="/portal.aspx" Text="Portal" runat="server"/>
                <br />
                <asp:LoginStatus ID="LoginState" runat="server"/>
            </LoggedInTemplate>
        </asp:LoginView>
    </form>

    Now I have got two member groups. Each member groups has got a different view on the menu. I am using the following XSLT snippet to create the menu for the client area:

    <xsl:when test="name() = 'portalCategory'">
        <xsl:if test="umbraco.library:HasAccess(@id, @path) = true()">
            <li>
                <h4>
                    <xsl:value-of select="@nodeName"/>
                </h4>
                <xsl:call-template name="subMenu">
                    <!-- Draw sub menu -->
                    <xsl:with-param name="childNodes" select="child::*"/>
                </xsl:call-template>
            </li>
        </xsl:if>
    </xsl:when>

    It works fine with public acces. So far there are no problems - each logged in member is just looking at the sites he is supposed to see. But now I want to show some user-specific information on the site. There are two users at the moment (One in group 1, the other one in group 2), with the ID's 1354 and 1451. However GetCurrentUser allways returns the the node with the ID 1451, even if the user 1354 is logged in!

    <xsl:copy-of select="umbraco.library:GetCurrentMember()" />

    I guess there is some problem with caching caused by the way I am handling login's. Is there anything I am doing wrong?

    Thank you,
    - Carsten.

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 26, 2011 @ 11:32
    Fuji Kusaka
    1

    Hi Carsten,

     

    If you are using v4.7.0 you might be having the Logout bug. You can either upgrade to version v4.7.1 or add a lougout button in a usercontrol to logout user completely.

    You might also have a look at this threat, same issue as yours.

     

    //fuji

  • Carsten 13 posts 33 karma points
    Oct 26, 2011 @ 13:03
    Carsten
    0

    Thank you, Fuji. I've updated to umbraco 4.7.1 and now everything works fine! :-)

Please Sign in or register to post replies

Write your reply to:

Draft