mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-12-18 01:30:42 +00:00
b5f42b8a74
Introduce BaseBlacklist::getSpamBlacklist() and getEmailBlacklist() as type-documented alternatives to getInstance( 'email/spam' ) so we don't need to keep documentating types in a comment when using a function that isn't included in the base class. Change-Id: Ic8bd8f803ddbce1294707d5f1d62b701e24d8c6e
15 lines
429 B
PHP
15 lines
429 B
PHP
<?php
|
|
|
|
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
|
|
|
|
class SpamBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
|
|
public function testForAccountCreation( $user, $creator, array $reqs ) {
|
|
$blacklist = BaseBlacklist::getEmailBlacklist();
|
|
if ( $blacklist->checkUser( $user ) ) {
|
|
return StatusValue::newGood();
|
|
}
|
|
|
|
return StatusValue::newFatal( 'spam-blacklisted-email-signup' );
|
|
}
|
|
}
|