Answered: How to limit registration to users with email account from special domain name?

Post date: 2021-10-17 10:44:58
Views: 272

Hi

I had a similar need as I installed Q2A on a website I developed on my workplace. I wanted my collegues to use their professionnal email adress (we just have one domain as to email), and it turned out to be quite simple

  1. I added a check with strpos to the class qa_filter_basic (pluginsqa-filter-basic.php) : strpos($email,'@yourdomain.ext')===false
  2. If the verification fails (the email does not belong to the specified domain), then return a message ("email_conseil_dep") saying only their professionnal mail is allowed. Message that I added - with a translation in French - to frqa-lang-users.php (you will have to do it in your specific folder)

This did the job for me. Hope it will be useful for someone out there

Kind regards

Paul V
France


 

Please click Here to read the full story.
 
Other Top and Latest Questions:
Silo: Whatever You Do, Don't Go Home Show Only
Analysis: A powerful new coalition of AI skeptics is coalescing right in Trump's blind spot
Saudi military strikes Houthi targets in Yemen after Iran-backed militia attacked Red Sea shipping
Meta likely to highlight smart glasses, avoid social media policy on upcoming earnings call, Kalshi traders say
Analysis: Kevin Warsh has three reasons to hold off on a Fed rate hike this week
SpaceX stock-purchasing by Congress members fuels conflict concerns
Amazon, Meta and Microsoft face skeptical investors this week after Google report sparked sell-off
Blurred front lines: Trump meets Zelenskyy as Ukraine, Iran wars collide
Trump: New tariffs 'doing the same thing' as the ones struck down by Supreme Court
Shein says it's under investigation by the Federal Trade Commission as it prepares for Hong Kong IPO