Copied to clipboard

Flag this post as spam?

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


  • sperr0w 48 posts 81 karma points
    Aug 22, 2009 @ 13:00
    sperr0w
    0

    xslt to SignOut member

    Hi!

    In my project I want to create macros, that return "SignOut" link .Using this link member can sign out from site.

    I jast wank to create control like in top left corner of codeplex.com:

    Registration  |  Sign In  |  Home - if member dont logged in

    Profile  |  Sign Out  |  Home -  if user logged in

    and my macros like this:

     

    <xsl:if test="$isLoggedOn = 1">
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="$EditProfileHref"/>
    </xsl:attribute>
    <xsl:attribute name="class">
    <xsl:text>ZoomFix</xsl:text>
    </xsl:attribute>
    <xsl:text>Profile</xsl:text>
    </a>
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="#"/>
    </xsl:attribute>
    ??????????????????????????????????????????????????????????????????????
    <xsl:attribute name="name">
    <xsl:text>modal</xsl:text>
    </xsl:attribute>
    <xsl:text>Sign Our</xsl:text>
    </a>
    </xsl:if>
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="/"/>
    </xsl:attribute>
    <xsl:attribute name="class">
    <xsl:text>ZoomFix</xsl:text>
    </xsl:attribute>
    <xsl:text>Home</xsl:text>
    </a>



    what can type in instead "?????" to make sign out link ?

  • bob baty-barr 1180 posts 1294 karma points MVP
    Aug 22, 2009 @ 16:31
    bob baty-barr
    0

    in the package repo, you can download and install the member controls -- these have editable ascx files where you could add some additional logic... but they will perform your loginStatus elements that you speak of.

  • sperr0w 48 posts 81 karma points
    Aug 22, 2009 @ 17:06
    sperr0w
    0

    could u give me link to this package?

    I want to know exactly how to sign out form xslt macro. May be I can use XSLT extension where a write comething like this:

    Member.ClearMemberFromClient(Member.GetCurrentMember());

    base.Response.Redirect(requestHandler.cleanUrl(), true);

    If somebody know, how to do it, please write here.

  • Mike McCullough 54 posts 67 karma points
    Aug 22, 2009 @ 19:28
    Mike McCullough
    102

    It's really easy to do with Umbraco version 4. You can use built in ASP.Net member controls.  Place this in an ASCX file and create a macro. Insert the macro in your template.

     

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MemberLoginInHeader.ascx.cs" Inherits="osMemberControls.MemberLoginInHeader" %>
    <asp:LoginView ID="UmbracoLoginView" runat="server">
        <LoggedInTemplate>
    <div id="login_options">
                        Welcome <strong><asp:LoginName ID="LoginName1" runat="server" /></strong> |
                        <asp:LoginStatus ID="LoginStatus1" runat="server" />
                        | <a href="/Link-Here">Link here</a>
                    </div>
        </LoggedInTemplate>
        <AnonymousTemplate>
            <div id="login_options">
    <asp:Login ID="Login1" runat="server" DestinationPageUrl="/myprofile"></asp:Login>
            </div>
        </AnonymousTemplate>
    </asp:LoginView>

     

  • sperr0w 48 posts 81 karma points
    Aug 24, 2009 @ 05:35
    sperr0w
    0

    Thanks for your answer, Mike! I create this control as u say and all work. But I'm interesting, is there way to log out over XSLT? may be to use XSLT extension?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 24, 2009 @ 08:58
    Aaron Powell
    0

    I wouldn't recommend using XSLT as it'd connect in with the old membership model, not the new one of v4+.

  • Daniel Lindstrom 454 posts 271 karma points
    Aug 24, 2009 @ 15:10
    Daniel Lindstrom
    0

    If you really want to sign out using an xslt macro instead of the asp.net log out control extending your xslt with custom functions might be an option:

    http://our.umbraco.org/wiki/reference/xslt/extend-your-xslt-with-custom-functions

    In the c# function then put:

    FormsAuthentication.SignOut();

    and maybe also:

    Roles.DeleteCookie();
    Session.Clear();

    Slace, I am curious, what does it mean when you say 'the old membership model'?

     

Please Sign in or register to post replies

Write your reply to:

Draft