mediawiki-extensions-SpamBl.../includes/SpamBlacklistPreAuthenticationProvider.php
Reedy 52bb0939d9 Namespace extension
Change-Id: Ie53302078d5f405eaa6caef3b7ef4daebf47d877
2022-04-08 13:41:20 +00:00

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