Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

hiding user profiles from guests

Quote Reply
hiding user profiles from guests
Where in the template codes would I need to place the <%if user_id%> <%endif%> tags to prevent guests from viewing user profiles?

I have already disabled the Who's Online feature for guests, but literally everything is hyperlinked with the author's profile. I would just like to turn that feature off - for guests.
Quote Reply
Re: [shiner] hiding user profiles from guests In reply to
You could just edit the action in Admin so that guests could click but would get a "permission denied" error.

Realiiity.com Forums
Quote Reply
Re: [shiner] hiding user profiles from guests In reply to
The easiest thing to do would be to set the minimum forum permission for the user_view action to Registered Users - that way, any guest that clicks it will be taken to a login page with an error message:

Guests are not authorized to access that page. Please login as a user

Note that you'll want to do this even if you do decide to edit the templates to remove the link - otherwise someone could enter: gforum.cgi?username=Fred and view Fred's profile. As far as template changes go, you're looking at many, many changes as you mentioned. Basically, everywhere you find <%msg_username%>, <%post_username%>, or <%user_username%> is going to be linked right now - it'll be something like:

<a href="gforum.cgi?username=<%user_username%>"><%user_username%></a>

You'd have to change all of them to:

<%if current_user_id%><a href="gforum.cgi?username=<%user_username%>"><%user_username%></a><%else%><%user_username%><%endif%>

However, since usernames appear in many, many places, I would think just disabling the action and having the error message display is a much easier option.

Jason Rhinelander
Gossamer Threads
Quote Reply
Re: [Jagerman] hiding user profiles from guests In reply to
That was the answer! Thanks! It was much easier than I had anticipated. In 1.1.4 you can set the minimum user status - excellent!

Thanks again for your time!