mediawiki-extensions-SpamBl.../SpamBlacklistPreAuthenticationProvider.php
Gergő Tisza 303ba31639 Update for AuthManager
Needs I8b52ec8ddf494f23941807638f149f15b5e46b0c to
do anything useful.

Bug: T110467
Change-Id: Ifb6fea581a0d0ae8db46e82b6fa6d25239cf3d8e
2016-05-11 22:32:49 +00:00

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