Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How do I redirect to login page?

Quote Reply
How do I redirect to login page?
I tied this on my template:



<%if Username%>

Show the page

<%else%>

<meta http-equiv="refresh" content="0; url=my login page">

<%endif%>



I want to make that page available for members only. Somehow <%if Username%> doesn’t detect if the member is loged and sends all traffic to the redirected page.



I know there is a commercial plugin, but it’s too expensive. Was wondering how that could be done?

I prefer not to use hooks.


Thanks!


Quote Reply
Re: [Kool] How do I redirect to login page? In reply to
Hi,

Mmm.. it shouldn't do.

Try:
Code:
<%if user.Username%>
show page
<%else%>
<meta http-equiv="refresh" content="0; url=<%config.db_cgi_url%>/user.cgi">
<%endif%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How do I redirect to login page? In reply to
Hello Andy,

Thank you for the help!

It still doesn’t work <%if user.Username%> doesn’t seem to detect the user.

I’m using a template and have that on top <%get_link_tags($ID)%>

That works, because when I place <%Username%> on the page it prints the correct username.

Thanks again!

Dave
Quote Reply
Re: [Kool] How do I redirect to login page? In reply to
Hi,

Are you running static or dynamic pages? If running in static, it obviously won't work. If not, I can't see any reason why that above code wouldn't work Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How do I redirect to login page? In reply to
Running dynamic
Quote Reply
Re: [Kool] How do I redirect to login page? In reply to
Hi,

If you don't mind sending over GLinks access (email, or PM), I'll take a look for you. It should be working.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] How do I redirect to login page? In reply to
Hi,

For anyone interested, it was a cookie issue. I set the cookie "domain", and it all works fine now :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!