[ic] Members_only & Login Redirect

Ron Dorman interchange-users@lists.akopia.com
Sat Jul 14 23:18:01 2001


Ron Dorman wrote:

> Been fighting this problem for 2 weeks, I will be bald soon if I don't
> get this figured out.
>
> The problem is this:
> person before me modified v4.6.1 Construct demo flypage template to [set
> members_only]1[/set] requiring login, and/or new account entry, before
> displaying the flypage with the item detail.  This works fine.
>
> after login, or new account entry, the user is returned to the site home
> page due to
>     [set Log In]
>     [if session logged_in]
>     mv_nextpage=index
>     [else]
>     mv_nextpage=login
>     [/else]
>     [/if]
>     [/set]
> in the login.html file
>
> We need to send the user on to the flypage for requested product info
> instead of the site home page.
>
> I have worked with 'A HREF="[history-scan' in several variations,
> setting scratch variables and using 'bounce href=scratch variable' in
> several variations.  And a few other things from the archives.  Nothing
> has worked yet.
>
> I would prefer to use the history-scan option so users are always
> returned to where they were going.
>
> Since the members_only flag is set on the flypage, does it not get added
> to history befor redirecting to 'login'?
>
> Do flypages not get added to history at all?
>

With this code in the template, how do I use the mv-successpage variable to
return to the members_only page that redirected to login?

[if scratch members_only]
    [set members_only][/set]
    [if !session logged_in]
    [set mv_successpage]@@MV_PAGE@@[/set]
    [bounce page=login]
    [/if]
[/if]

This code says if members only is set to yes and the visitor is logged in,
display the page. Otherwise, redirect the visitor to the login page.