Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
16.4k views
in Q2A Core by

 

I recently installed question2answer and I am really happy with it. I would like the questions to be only visible to members of our organization. 
 
I tried to hide as much as possible for anonymous users. Unfortnately the list of questions is still visible. Is there a way to hide it? 
 
Furthermore I would like to know if it is possible to give only users access after they have received my approval? 
Q2A version: latest version

3 Answers

+3 votes
by
edited by
 
Best answer

"Unfortnately the list of questions is still visible. Is there a way to hide it?"

Yes. Open \qa-theme\NAME OF SELECTED TEMPLATE\qa-theme.php
 
insert the following code directly after the line which contains <?php
 
if ((!qa_is_logged_in()) and !((strpos(qa_self_html(),'login') !== false )||(strpos(qa_self_html(),'forgot') !== false ))) {
qa_redirect('login');
}else{
 
and add the following codejust before the end of the file (but before ?> if it contains ?>)
}

"(...) is possible to give only users access after they have received my approval?"

No this is not possible. A workaround: manually create all users and after that tick "Temporarily suspend new user registrations", in that way you can prevent uninvited users from joining the platform.

0 votes
by

Solutions using Administration panel:

  • "Unfortnately the list of questions is still visible. Is there a way to hide it?"

I couldn't find any solution for this but you can limit access to the questions content at

"Permissions > View question page".

  • "(...) is possible to give only users access after they have received my approval?"

Yes. You can set users with fewer than X points to have their content moderated before publishing.

"Spam > Use moderation for users with few points than X."

by
Thanks for the answer. On the permission page, I already set everything to registered users with email confirmed or higher. However I don't see the "View question page" in the list of permissions.
I think I will manually create all users and after that tick "Temporarily suspend new user registrations", in that way I can prevent uninvited users joining the platform.
0 votes
by

I think you can do with custom / advance theme by wrapping questin list with qa_is_logged_in()

Something like this

if (qa_is_logged_in()){

$this->main(); // this you need to work it out

}

So with about code ti wll hide all content from no logged in user

by
I manage to solve it by adding the following code to qa-theme.php for the selected template:
if ((!qa_is_logged_in()) and !((strpos(qa_self_html(),'login') !== false ))) {   
    qa_redirect('login');
}else{
  CURRENT CODE OF THE TEMPLATE
}
...