Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

How to deny guest to access category?

Quote Reply
How to deny guest to access category?
How to set that when a guest access the forum, it show a login form but not the category lists.
Quote Reply
Re: [backdream] How to deny guest to access category? In reply to
Hello backdream
hopefully I understood you correctly

go to your Admin Planel
go to Forn
select there the forum of your choice
and modify
With Group Permission you can make the attitudes for Guest users and Non Validated users

Greets hoefti
linktobuy Web Directory
Ratgeber Recht
Quote Reply
Re: [hoefti] How to deny guest to access category? In reply to
Thanks for your reply. But this only hide the forum list, how to hide the categoty list and give them a login form?
Quote Reply
Re: [backdream] How to deny guest to access category? In reply to
Hello

Ok i understand

in your Admin Planel
open template
category_list.html
after the head of this template
( --%> )

put <%if current_Username%>

at the end of the Site
put <%else%>

<%include login.html%>

<%endif%>

As current_Username will only be available if a user has logged in.

if he not logging in the login.html will be iincluded

Greets hoefti
Sorry about my englisch :)
linktobuy Web Directory
Ratgeber Recht
Quote Reply
Re: [hoefti] How to deny guest to access category? In reply to
That should be: <%if current_user_username%> instead of <%if current_Username%> - but it's probably better to use: <%if current_user_id%> - checking the username could fail if someone signed up with the username "0".

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] How to deny guest to access category? In reply to
Thanks, It's good.

But can I hide some but not all categories? I think Jagerman would add a option in Admin category panel to control it .
Quote Reply
Re: [backdream] How to deny guest to access category? In reply to
Basically, a user who hasn't logged in will have their permission defined by the permissions of the Guest group. So, if you have a forum set to:
  • No Access - the group won't see the forum in the list
  • Viewable in forum list - the group will see the forum name, but it isn't linked and they won't be able to see what's in it
  • Posts viewable but not readable - the group will be able to enter it and see the lists of posts, but won't be able to actually read them.
  • Read access - the group can enter the forum and read posts (this is the default for the guest group)
  • Read/Reply - the group can enter the forum, read posts, and reply to any threads
  • Read/Reply/Post - the group can enter the forum, read posts, reply to any threads, and start new threads


So, set forums that guests shouldn't see to "No Access" and leave the ones that they should be able to view as "Read access" (the default).

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] How to deny guest to access category? In reply to
Yes , I know it , but I want to hide the category name when all of forums under it have set to "No Access". But now it will show category name and with a infomation "Sorry, there are no forums or subcategories in this category" under it.
Quote Reply
Re: [backdream] How to deny guest to access category? In reply to
Oh, I see. You can do that by putting:

Code:


<%if num_forums or num_subcats%>





<%endif%>


around the category display.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] How to deny guest to access category? In reply to
Thanks, It works fine.
Quote Reply
Re: [Jagerman] How to deny guest to access category? In reply to
Hi Ian

I had this working but now that I have created a subsection in a section below root, the top section which has subsections (and discussions) is displayed.

For example you have
Products [-]
and then Gossamer Mail [-]

when I use this code Gossamer Mail and content is not displayed, however "Products" is displayed but no content below.

Also could you give a better indication as to where the "category display" starts and stops, maybe I didn't put my <%endif> far enough down.


John
Significant Media
Quote Reply
Re: [Jagerman] How to deny guest to access category? In reply to
Hello Jason,
Along the lines of this thread, would it be possible to set up a 'private' category that only users belonging to a certain group could see ?

In pseudo-perl:
Code:
if (category_name=~/private/) {
next unless user_group=~/SPECIAL/;
}

Thanks.
Bob