mediawiki-extensions-SpamBl.../includes/SpamBlacklistPreAuthenticationProvider.php
Umherirrender 7da5c87df0 Add function documentation
Change-Id: I3a8c0c6576f5a0bb1f68f906a8ec37ec079924f4
2024-11-25 22:16:37 +01:00

19 lines
512 B
PHP

<?php
namespace MediaWiki\Extension\SpamBlacklist;
use MediaWiki\Auth\AbstractPreAuthenticationProvider;
use StatusValue;
class SpamBlacklistPreAuthenticationProvider extends AbstractPreAuthenticationProvider {
/** @inheritDoc */
public function testForAccountCreation( $user, $creator, array $reqs ) {
$blacklist = BaseBlacklist::getEmailBlacklist();
if ( $blacklist->checkUser( $user ) ) {
return StatusValue::newGood();
}
return StatusValue::newFatal( 'spam-blacklisted-email-signup' );
}
}