Gossamer Forum
Home : Products : Gossamer Links : Discussions :

user must not be logged in to be user

Quote Reply
user must not be logged in to be user
maybe i get this one wrong but when you enter a

<%if user%> tag into a template there must not be a valid user but it is

sufficient if you enter user=xxx in the url.

maybe the system is too good here.
Quote Reply
Re: [el noe] user must not be logged in to be user In reply to
Try

<%if USER%>
Quote Reply
Re: [Paul] user must not be logged in to be user In reply to
Hi Paul,

Thanks for your quick reply.

The "feature" still exitsts. I did not write USER in the post because I did not look in the template but

I certainly used USER in the templates otherwise it would not have worked.

Regards

Niko
Quote Reply
Re: [el noe] user must not be logged in to be user In reply to
Hi,

The only way to make this safe from cgi input (as by default any cgi input can be used in a tag) is to add the following global:

is_logged_in => sub { return $USER ? 1 : 0 }

and then do:

<%if is_logged_in%>
..
<%endif%>

CGI input can not override globals, so even if someone passes in is_logged_in=1 in the query string, it won't work.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] user must not be logged in to be user In reply to
O.K. that was exactly what I was looking for.
Thank you very much Alex.
Quote Reply
Re: [el noe] user must not be logged in to be user In reply to
Is this still valid for GL 3.2.0?
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] user must not be logged in to be user In reply to
Hi,

Don't see why it wouldn't work.

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] user must not be logged in to be user In reply to
This works only in pagecreator sites and user_modify-sites, but not in home, search or category-page. Is there a better way to check in dynamic mode, if someone loggedin is visiting.

Christian
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] user must not be logged in to be user In reply to
Code:
<%if user.Username%>
whatever
<%endif%>

Thats how it shoudl be done in GLinks.

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!