Copied to clipboard

Flag this post as spam?

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


  • pat 124 posts 346 karma points
    Apr 07, 2011 @ 13:30
    pat
    0

    redirect to another page within xslt code

    I need to restrict access to a umbraco page , if website user logged in and have access to that perticuler page, in member area under the member type there is true/false property call accessToPageA so if customer logged in and accessToPageA=true then customer can see the page otherwise redirect to login page or subscribe request page

    this is what i have tried but it gave error on save xslt.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:msxml="urn:schemas-microsoft-com:xslt"
     xmlns:umbraco.library="urn:umbraco.library" xmlns:RedirectHelper="urn:RedirectHelper"  xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
     exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
      <msxml:script implements-prefix="RedirectHelper" language="C#">
        <msxml:assembly name="System.Web"/>
     <![CDATA[
      public void Redirect(int pageid)
      {
        Response.Redirect(umbraco.library.NiceUrl(pageid));
      }
     ]]>
      </msxml:script>
    <xsl:template match="/">
     <xsl:variable name="LoginPage" select="1094"/>
      <xsl:choose>
       <xsl:when  test="umbraco.library:IsLoggedOn()">
        <!--need check for user got access to page or not-->
        <xsl:if test="">

        </xsl:if>
       </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="RedirectHelper:Redirect($LoginPage)"/>
      </xsl:otherwise>
     </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>

    how to complete this task please

Please Sign in or register to post replies

Write your reply to:

Draft