2007/10/23, Aron Hennerdal aron.hennerdal@cbr.su.se:
Why not. I could use some feedback, as I'm not very experienced in php or mediawiki myself.
New code in LocalSettings.php:
# Restrict user creation to mydomain0.com/mydomain1.com function fnAbortNonMyDomainHook($user, $message) {
global $wgRequest; $email = $wgRequest->getText( 'wpEmail' ); $emailSplitList = split("@", $email, 2); if ( $emailSplitList[1] != "mydomain0.com" && $emailSplitList[1] != "mydomain1.com" ) { $message = "The only allowed e-mail domains are mydomain0.com and mydomain1.com"; return false; } return true; }
This will not work: a (valid) email address like '"bob@example0.com"@evil.com' (including the double quotes, not including the single quotes) will pass, even though it's not actually supposed to.