mediawiki-extensions-SpamBl.../includes/SpamBlacklistPreAuthenticationProvider.php
Kunal Mehta b5f42b8a74 Add phan configuration
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
2018-02-24 17:26:25 -08:00

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' );
}
}