Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
SpamBlacklistPreAuthenticationProvider
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 testForAccountCreation
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\Extension\SpamBlacklist;
4
5use MediaWiki\Auth\AbstractPreAuthenticationProvider;
6use StatusValue;
7
8class SpamBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
9    /** @inheritDoc */
10    public function testForAccountCreation( $user, $creator, array $reqs ) {
11        $blacklist = BaseBlacklist::getEmailBlacklist();
12        if ( $blacklist->checkUser( $user ) ) {
13            return StatusValue::newGood();
14        }
15
16        return StatusValue::newFatal( 'spam-blacklisted-email-signup' );
17    }
18}