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

Anonymous can still ask question even though permissions are disallowing it

0 votes
68 views
asked Dec 4 in Q2A Core by q2apro
I set the permission "Asking questions" to "Registered users with email confirmed" few days ago. Before users were allowed to ask as guests.

Today I see that anonymous guests can still posts questions!

Is that a bug? Or can they do so because of a cookie set? What could be the reason?
Q2A version: 1.8.0
commented 4 days ago by q2apro
Anonymous can still post, i am confused. When I visit the /ask page (private mode), it says "you need to login or register". So there must be a way for some anonymous users to post a question still.

I thought it could be a cookie issue, but checking the IP, it says it is used the first time. Unfortunately the user did not leave his email address (for notifications), so I cannot ask how that was possible.
commented 4 days ago by q2apro
For another user I see that he was loggedin, then posted, then logged out, then posted as guest, then logged-in again and posted with user account again. I am not sure what the cause of the problem is. In the user-rules plugin it retrieves the userid, if it is not set then it is not changing the user permissions (in my new version). So I doubt that the plugin is the culprit. It should be something else.
commented 2 days ago by Scott
Have you tried completely disabling that plugin and seeing if people can still post anonymously? Also maybe try contacting that user and ask exactly what they did.
commented 7 hours ago by esqeudero
your plugin is not a problem definitely. It seems to me that it is a caching issue. On lines 168 below, if (isset($userid) &&  $userid > 0 && qa_opt('permit_post_q') != QA_PERMIT_ALL) statement can be written to fix it. Note that I have not test it as I didnt experience such as problem.

https://github.com/q2a/question2answer/blob/1f39ae44adf42c83042be631e39373893a3ec969/qa-include/pages/ask.php

Please log in or register to answer this question.

...