Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
530 views
in Q2A Core by
If I ban a user they don't get logged out. For most cases this is fine since they can't post or do anything on the site, but they can still use plugins, unless you specifically check if they're banned.

Just thought it would be useful to make sure the user gets logged out by deleting the session code or whatever.

1 Answer

0 votes
by

Hmmm... I can see your point but am not sure whether or not this is the right thing to do, since I think blocked users should still be able to perform read operations that are tied to their identity. I guess it depends on the plugin.

So for now let me just explain how a plugin can check if the user is blocked:

if (qa_get_logged_in_flags() & QA_USER_FLAGS_USER_BLOCKED) {
  // user is blocked
}

by
What kind of things do you mean by "read operations that are tied to their identity"? Visitors can see everything whether logged in or not, right?
But no worries, I added that code to my plugin :)
by
I was thinking of plugins that showed people information based on their Q2A identity. For example, off the top of my head, a plugin that showed people who they had interacted with most.
...