Copied to clipboard

Flag this post as spam?

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


  • Garry Bain 149 posts 124 karma points
    Oct 28, 2009 @ 17:47
    Garry Bain
    0

    Logout button for members

    Hi,

    I am using the following code to show a "Log In" link if a member is not currently logged in, and this changes to "Log Out" if they are logged in. However, I'm unsure of what the link should be to actually log someone out.

    <xsl:choose>
        <xsl:when test="umbraco.library:IsLoggedOn() = true()">
            <a href="???????????">
                Log Out <xsl:value-of select="umbraco.library:GetCurrentMember()/@loginName"/>
            </a>

       </xsl:when>
        <xsl:otherwise>
            <a href="/log-in.aspx">Login</a>
        </xsl:otherwise>
        </xsl:choose>

    As you can see on Line 3 - I'm unsure of what this url should be in order to log the member out. Any help would be great, Garry.

  • Chris Koiak 700 posts 2626 karma points
    Oct 28, 2009 @ 19:38
    Chris Koiak
    2

    Hi Garry,

    It depends on what controls you are using to perform the login. Are you using the standard asp.net login controls?

    If so, you could always use the LoginStatus Control

    <asp:LoginStatus id="ccLogin" runat="server"
        LoginText="Sign In"
        LogoutText="Sign Out"
        LogoutPageUrl="~/default.aspx"
        LogoutAction="Redirect" />

     

     

    Cheers,

    Chris

  • skiltz 501 posts 701 karma points
    Oct 28, 2009 @ 20:30
    skiltz
    1

    And for the record if you want to signout somone from a codebehind.

    FormsAuthentication.SignOut();
    FormsAuthentication.RedirectToLoginPage();
  • Garry Bain 149 posts 124 karma points
    Oct 29, 2009 @ 09:58
    Garry Bain
    0

    I dont understand how these "controls" work - I have used the Member package from the repository which allows users to login so they can see protected pages etc. The logout button that comes with the package has this code - but this only works on the login page that you create.

    <a href="javascript:__doPostBack('ctl00$ctl00$ctl00$ContentPlaceHolderDefault$RunwayMasterContentPlaceHolder$umbLogin_2$LinkButtonLogout','')">Sign out</a>

    This javascript method will only work on the same page you use to login though.

    I have more or less 95% of the functionality I need with this package so I don't wish to move away from it. Are there any tutorials with how to get to grips with these "controls" that you give above - as Im not an asp developer I just try to get along with XSLT when I use umbraco.

    Cheers, Garry.

  • Chris Koiak 700 posts 2626 karma points
    Oct 29, 2009 @ 11:18
    Chris Koiak
    0

    I think there's a xslt extension in my ClientArea project your could use.. have a look at our.umbraco.org/projects/clientarea

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies