Developer forum

Forum » CMS - Standard features » Extranet login - page when logged in

Extranet login - page when logged in

Jens Jakob Kristensen
Jens Jakob Kristensen
Reply

Hi,

I have a question regarding Extranet login for a B2B shop.

Product pages are public, but if you login (Extranet) you can see prices and add products to cart. 

We want to have login-link in the master template so the login link is at the top of all pages. Clicking the login-link renders a login form (Extranet) in a modal or similar. We do not wish to send the user to a different page to log in.

My question:
If the user is on a specific URL, and logs in, will the user end up on the same URL again when logged in? In the same proces?

Thank you in advance.


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Jens Jakob

You can do that - you can see an example here: http://wrap.dynamicweb-cms.com/

This is the login dialog:

<form role="form" id="loginform" method="post">
    <div class="modal-body">
        <input name="ID" value="8398" type="hidden">
        <input name="DWExtranetUsernameRemember" value="True" type="hidden">
        <input name="DWExtranetPasswordRemember" value="True" type="hidden">
        <div class="form-group">

            <label for="username">Email</label>
            <input class="form-control" name="username" id="username" placeholder="Skriv email" value="" type="text">
        </div>
        <div class="form-group">

            <label for="password">Kodeord</label>
            <input class="form-control" name="password" id="password" placeholder="Skriv kodeord" type="password">
            <p>&nbsp;</p>
            <a class="pull-left" href="/Default.aspx?ID=8482&amp;LoginAction=Recovery">Har du glemt dit kodeord?</a>
            &nbsp;
        </div>
    </div>
    <div class="modal-footer">
        <div class="row">
            <div class="col-md-12">
                <div class="checkbox pull-left">
                    <label>
                        <input name="Autologin" checked="checked" value="True" type="checkbox"> Husk mig
                    </label>
                </div>
                <button type="submit" class="btn btn-xs btn-base pull-right">Log ind</button>
            </div>
        </div>
    </div>
</form>

If you do not do anything else, the login will redirect you back to this page (the referer).

You can also add a hidden field to the login dialog: <input type="hidden" value="Default.aspx?ID=123&something=else" name="Redirect"> and the login will redirect to that, or you can say it should not make any redirects doing like this: <input type="hidden" value="False" name="Redirect">

BR Nicolai

Votes for this answer: 1
 
Jens Jakob Kristensen
Jens Jakob Kristensen
Reply

Thanks nicolai - that was what I was looking for :-)

 

You must be logged in to post in the forum