null, ]; $options += $defaults; $this->systemBlockType = $options['systemBlock']; } /** * Get the system block type, if any. A SystemBlock can have the following types: * - 'proxy': the IP is blacklisted in $wgProxyList * - 'dnsbl': the IP is associated with a blacklisted domain in $wgDnsBlacklistUrls * - 'wgSoftBlockRanges': the IP is covered by $wgSoftBlockRanges * - 'global-block': for backwards compatability with the UserIsBlockedGlobally hook * * @since 1.29 * @return string|null */ public function getSystemBlockType() { return $this->systemBlockType; } /** * @inheritDoc */ public function getPermissionsError( IContextSource $context ) { $params = $this->getBlockErrorParams( $context ); // TODO: Clean up error messages params so we don't have to do this (T227174) $params[ 4 ] = $this->getSystemBlockType(); $msg = 'systemblockedtext'; array_unshift( $params, $msg ); return $params; } /** * @inheritDoc */ public function appliesToPasswordReset() { switch ( $this->getSystemBlockType() ) { case null: case 'global-block': return $this->isCreateAccountBlocked(); case 'proxy': return true; case 'dnsbl': case 'wgSoftBlockRanges': return false; default: return true; } } }