On 12/04/2010 12:39 AM, Platonides wrote:
[snip]
>> Is there any practical way of blocking new
users from using specific
>> services like Mailinator? Is there a better way of dealing with
>> situations like this?
[snip]
$wgHooks['AbortNewAccount'][] =
'noMailinator';
function noMailinator( $user,&$message ) {
if( !preg_match( '/(a)(mailinator|binkmail).com$/'m$/', $user->getEmail() ) {
$message = 'No mailinator emails, please';
return false;
}
return true;
}
Another option would be the isValidEmailAddr hook.
Sorry for the late reply. I've just had a chance to look at this again
- prompted by yet another spammer using mailinator to authenticate their
account.
I took a quick look at the $wgHooks docs here:
http://www.mediawiki.org/wiki/Manual:Hooks and
http://www.mediawiki.org/wiki/Manual:Hooks/AbortNewAccount
Seems straight forward, so I added the code (with and without the & in
front of the $message variable) to my LocalSettings.php... and it didn't
work so well. According to my error log it had a "PHP Parse Error:
syntax error, unexpected '{'" at the end of the first line of the if
statement. Funny thing is... I don't see a syntax error there though
(granted I'm not a php guru... still learning, so I might be missing
something).
I tried a few variations on the function code (including the suggestion
from OQ) with the same results.... an unexpected '{'.
So at this point I'm a little puzzled... any suggestions on where the
problem is?
C.