Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
how can i allow hompage public,but discussion page private?
that means:
people can see the content of homepage without login,
but they can't see the content of discussion page before login, when they open a discussion url, they are redirected to the login page.
i think maybe add some code to the discussion php(applications/vanilla/views/discussion/index.php) code, to Judgment if users are logined.
but i don't know how, can anyone help me? thanks.
people can see the content of homepage without login,
but they can't see the content of discussion page before login, when they open a discussion url, they are redirected to the login page.
i think maybe add some code to the discussion php(applications/vanilla/views/discussion/index.php) code, to Judgment if users are logined.
but i don't know how, can anyone help me? thanks.
0
Answers
grep is your friend.
grep is your friend.
But you can use permissions to prevent people from being able to read (won't show up in discussion lists) categories unless they have the correct role (being logged in is a role)
There was an error rendering this rich post.
Permission('Vanilla.Discussions.Add');
that is becuase what you are saying is those that can't add shouldn't view. This may redirect to "not authorised" page rather than login.CheckPermission
will give a Boolean result.Don't edit the core
You could use
Discussion_BeforeRender_Handler
, this isn't that efficient becuase you are doing work then discarding it. As would be the case if you used a view.So the more efficient way to do it is use the hook
Dispatcher_AfterAnalyzeRequest_Handler
then checkif(strtolower($Sender->OriginalRequestMethod)!='discussion') return;
So we are dealing with discussion. Then your$Sender->Permission('Vanilla.Discussions.Add');
or whichever works best for you. Read up on plugins / themehooks if you haven't already.grep is your friend.