Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...

AspDotNetStorefront
DotFeed

How can i require a user to be logged in to see the site?

Hey, we are migrating a site from v9 to v10.  However, we need the site to be 'locked down' meaning that the webpage must prompt you for a username and password before even letting you see the website. Is there a JS object running arround with a IsUserLoggedIn?

We need the every page to redirect to login when the is not logged in.
asked Sep 11, 2017 in General by zurc (200 points)

1 Answer

+1 vote

If you're using xml packages you can do something like this,  though this does not do the redirect it might be something you might want. 



 <xsl:variable name="CurrentUrl" select="/root/Runtime/PageName" />
<xsl:if test="/root/System/CustomerFirstName='' ">
                    <!--YOUR CONTENT-->
                    <p class="strong">
                      We sell to licensed professionals only.<br />
                      Please login or register:
                    </p>
                    <p>
                      <a class="btn btn-primary" id="CurrentURL" runat="server" href="/signin.aspx?ReturnURL={$CurrentUrl}">LOGIN</a>
                      <a class="btn btn-secondary" href="/createaccount.aspx">REGISTER</a>
                    </p>
</xsl:if>


 


answered Oct 23, 2017 by Joshua (215 points)
...