mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-27 16:40:04 +00:00
52bb0939d9
Change-Id: Ie53302078d5f405eaa6caef3b7ef4daebf47d877
18 lines
492 B
PHP
18 lines
492 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\SpamBlacklist;
|
|
|
|
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
|
|
use StatusValue;
|
|
|
|
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' );
|
|
}
|
|
}
|