mediawiki-extensions-SpamBl.../includes/SpamBlacklistPreAuthenticationProvider.php

15 lines
429 B
PHP
Raw Normal View History

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