2016-05-08 08:17:29 +00:00
|
|
|
<?php
|
|
|
|
|
2022-04-08 13:05:02 +00:00
|
|
|
namespace MediaWiki\Extension\SpamBlacklist;
|
|
|
|
|
2016-05-08 08:17:29 +00:00
|
|
|
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
|
2022-04-08 13:05:02 +00:00
|
|
|
use StatusValue;
|
2016-05-08 08:17:29 +00:00
|
|
|
|
|
|
|
class SpamBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
|
|
|
|
public function testForAccountCreation( $user, $creator, array $reqs ) {
|
2018-02-25 01:25:04 +00:00
|
|
|
$blacklist = BaseBlacklist::getEmailBlacklist();
|
2016-05-08 08:17:29 +00:00
|
|
|
if ( $blacklist->checkUser( $user ) ) {
|
|
|
|
return StatusValue::newGood();
|
|
|
|
}
|
|
|
|
|
|
|
|
return StatusValue::newFatal( 'spam-blacklisted-email-signup' );
|
|
|
|
}
|
|
|
|
}
|