mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-24 07:04:04 +00:00
16 lines
472 B
PHP
16 lines
472 B
PHP
|
<?php
|
||
|
|
||
|
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
|
||
|
|
||
|
class SpamBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
|
||
|
public function testForAccountCreation( $user, $creator, array $reqs ) {
|
||
|
/** @var $blacklist EmailBlacklist */
|
||
|
$blacklist = BaseBlacklist::getInstance( 'email' );
|
||
|
if ( $blacklist->checkUser( $user ) ) {
|
||
|
return StatusValue::newGood();
|
||
|
}
|
||
|
|
||
|
return StatusValue::newFatal( 'spam-blacklisted-email-signup' );
|
||
|
}
|
||
|
}
|