Extension talk:EmailDomainCheck

Jump to navigation Jump to search

About this board

DukeEgr93 (talkcontribs)

I'm afraid this is broken for the newest version of MediaWiki; I looked at trying to fix it but am not all that well versed in php. Seems that the wfMessage needs to be put in, but also I can't get $user->getEmail() to produce results.

Orudge (talkcontribs)

Hm, it looks like a PreAuthenticationProvider needs to be implemented - https://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccountManual:Hooks/AbortNewAccount

Sdeaki (talkcontribs)
Cardcaptor Stacey (talkcontribs)

It's broken for me too. However, I've tried Sdeaki's extension and it works pretty good although, I do get:

Warning: Cannot modify header information - headers already sent by (output started at \mediawiki\extensions\RestrictEmailDomain\RestrictEmailDomain_body.php:15) in \mediawiki\includes\WebResponse.php on lineĀ 42

DukeEgr93 (talkcontribs)

Sdeaki - fantastic, and thank you!

Chefmw (talkcontribs)

Extension:EmailDomainCheck works on MediaWiki 1.29. I put in a fix in the error path (when a user attempts to create an account with an unsupported domain) by replacing wfMsgHtml() with wfMessage()

Reply to "Broken in 1.27?"

Can I restrict to a single domain, but allow certain users special access?

2 (talkcontribs)

Hi, Can I use this program to restrict registration to one or a few domains, but allow certain users with emails outside these domains editing privileges anyway?

For example: restrict my wiki to @illinois.edu domains, but allow eddie@ftu.edu as well?


Gregology~mediawikiwiki (talkcontribs)
Reply to "Can I restrict to a single domain, but allow certain users special access?" (talkcontribs)

I got a question tho, can I use this if I want to allow multiple domains? (talkcontribs)

you have to change the code like follows:


$wgEmailDomain = "foo.com";


$wgEmailDomain=array("news.com","foo.com","bar.com"); //Array of allowed domains


if ($host == $wgEmailDomain){


if in_array($host,$wgEmailDomain){

regards, mlu

Antstamper~mediawikiwiki (talkcontribs)

I got this error using the array...

PHP Parse error: syntax error, unexpected 'in_array' (T_STRING), expecting '('

relating to the line

if in_array($host,$wgEmailDomain){

Grateful for any ideas...

This post was posted by Antstamper~mediawikiwiki, but signed as Antstamper.

Antstamper~mediawikiwiki (talkcontribs)
Reply to "This is just what i need."

Refreshing mediawiki page will show "Your email address must end in"

Mickbravo (talkcontribs)

I added this extension to my mediawiki and it is perfect.

But a lot of times when I'm just browsing through my wiki at the top of the page the following sentence is shown. "Your email address must end in" It is on top of the logo, the wiki is fine and usable but it annoys me. Does anyone has this too? And preferably knows how to solve this.

Note: I changed the following for sake of being able to check on multiple domains

function efEmailDomainCheck( $user, &$error ) {
        global $wgEmailDomain;
        if ( isset( $wgEmailDomain ) ) {
                list( $name, $host ) = explode( "@", $user->getEmail() );
                //if ( efEndsWith( $host, $wgEmailDomain ) ) { // use this line to allow subdomains of $wgEmailDomain
                if (in_array ( $host , $wgEmailDomain )){
                //if ( $host == $wgEmailDomain ) {
                        return true;
                } else {
                        $error = wfMsgHtml( 'emaildomaincheck-error', join(" or ",$wgEmailDomain) );
                        return false;

In my LocalSettings.php I use this line:

$wgEmailDomain = array("domain1.com","domain2.com","domain3.com"); //Array of allowed domains

When I look into the source of a shown page it tells me this in the first line. Does anyone have a tip?

Your email address must end in <!DOCTYPE html>
Reply to "Refreshing mediawiki page will show "Your email address must end in""

Does not kick in for Change Email page

1 (talkcontribs)

This works great, but it does not seem to kick in if the user goes to the change email page, and submits an unwanted email domain.

Is there a way to make this work with the change email page, or disable the change email page?

Otherwise a staff person could create a new account with an approved email domain, but using a fake name, then change the email using the change email page to an outside domain, and then we have no idea who they are.

Reply to "Does not kick in for Change Email page"
Pdeli (talkcontribs)


I hope I will not be off-topic with my question/issue...

Since the teachers of my university do not want to have their lectures to be public, I had to restrict the access to even readers (before only editors had to be registered, now this includes also readers, unfortunately). However, since the access requests of the students will probably (and hopefully) skyrocket, I found about the EmailDomainCheck extension that I setup on my test wiki.

However I noticed that if in LocalSettings.php I passed: $wgGroupPermissions['*']['createaccount'] = false;


$wgGroupPermissions['*']['createaccount'] = true;

People had just to give any e-mail address (even a non-existing one), having the correct domaine name and they would be registered with a welcome message and already logged in, thus bypassing the EmailDomainCheck extension.

Is there a way to restrict the account creation so that people have to click a button that sends the login credential to the mentioned e-mail address?

Thanks in advance and best regards, pdeli


Reply to "Read restricted wiki"

Domain Check to Restriction Levels

Bacamat (talkcontribs)

Hi, great extension. Does anyone know if i would be possible to automatically give users with a specified domain name a different restriction level from the default? That is, I want only users with emails from a certain domain name to be able to edit one page on my wiki.

Reply to "Domain Check to Restriction Levels"
There are no older topics