Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How do I only allow specified users not in a single sign on

+1 vote
asked May 24, 2017 in Q2A Core by anonymous
I have just set up my own instance of a Question 2 answer website but I'm struggling with the login aspect.

I only want specific email addresses to have the ability to login so anyone that is not on the list of addresses I have is told they can't log in, I have not made the site with the ability for single sign on as I attempted that already to no avail.

So far I have been unable to find anywhere in the admin section that allows me to white list specific e-mails or user ids so I was hoping there is a simple way of doing this? Whether it be in the DB, editing the code or in the admin section, any help would be much appreciated.
Q2A version: Latest

2 Answers

+1 vote
answered May 25, 2017 by ProThoughts
first create all required users and the close site with below kind of plugin or using admin->viewing options.

commented Dec 29, 2017 by mshah
Are you guys planning to develop any invite users plugin that lets existing users invite another user?

That will go well with q2a-closed-site plugin.
+2 votes
answered Jun 3, 2017 by Scott
One option is to enable approval of users (in Admin > Spam page). Also tick "all new users must be approved". Then you can deny all requests except the emails you want.

Besides that, the best solution would be a filter plugin: http://docs.question2answer.org/plugins/modules-filter/

Use the filter_email function, and if the email is not on your whitelist return an error message.
commented Jun 3, 2017 by ProThoughts
@scott, is it possible for you to add private site feature in q2a, once enabled then it should show only login page. I do see may people are looking for this. thanks
commented Jun 3, 2017 by Scott
Can't you set that in the permissions? Set "viewing question pages" to "registered users".
commented Jun 3, 2017 by ProThoughts
@scott, after setting that it still shows question. when clicked it asks for login. for private site only registered users should be able to see question, access to questions, answer ,images should be blocked once site is private.
commented Jun 4, 2017 by Scott
Oh OK I get it. Yeah it's probably worth adding a new permission for "viewing any pages".