Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
554 views
in Q2A Core by
I have recently installed a q2a site for my students and require them to use their school email address when using the site.

Currently I approve all users to ensure they are using the school email - but have come unstuck as some have gone back in and changed their email.

What would be the best way to stop users editing their own email acocunts?  

 

I am a novice at PHP but more than willing to try if that forms part of the solution.
Q2A version: 1.6.3

2 Answers

+1 vote
by
 
Best answer

1. Create and register a filter module.

2. For plugin class add the following function:

public function filter_email(&$email, $olduser)
{
    if (!empty($olduser)) {
        if ($email != $olduser['email']) {
            return 'You cannot change the email';
        }
    }
}

To read more about plugin developing, see http://www.question2answer.org/plugins-tutorial.php

0 votes
by
The only thing that is going to do is piss off your studients, there not Dumb! the only reason you want them to use the schools email is so the school can violate their privacy, about the only thing thats going to come from that is the school being taken to court for violating privacy rights...
...