= strtotime( $options['from'] ) && time() <= strtotime( $options['to'] ); if ( !$inTimeWindow ) { continue; } # 3) skip when throttle does not apply to the client IP $ip = $wgRequest->getIP(); if ( isset( $options['IP'] ) && !in_array( $ip, (array)$options['IP'] ) ) { continue; } if ( isset( $options['range'] ) && !IPUtils::isInRanges( $ip, (array)$options['range'] ) ) { continue; } # Finally) set up the throttle value global $wgAccountCreationThrottle, $wgTempAccountCreationThrottle, $wgRateLimits, $wgGroupPermissions; if ( isset( $options['value'] ) && is_numeric( $options['value'] ) ) { $wgAccountCreationThrottle = [ [ 'count' => $options['value'], 'seconds' => 86400 ] ]; } else { // Provide some sane default $wgAccountCreationThrottle = [ [ 'count' => 50, 'seconds' => 86400 ] ]; } // Unlike AccountCreationThrottle, wgTempAccountCreationThrottle has a default // value of 6 accounts per day. if ( isset( $options['tempaccountvalue'] ) && is_numeric( $options['tempaccountvalue'] ) ) { $wgTempAccountCreationThrottle = [ [ 'count' => $options['tempaccountvalue'], 'seconds' => 86400 ] ]; } $wgRateLimits['badcaptcha']['ip'] = [ 1000, 86400 ]; $wgRateLimits['badcaptcha']['newbie'] = [ 1000, 86400 ]; // T204583 $wgGroupPermissions['user']['autoconfirmed'] = true; // T227487 $wgGroupPermissions['*']['skipcaptcha'] = true; // No point in proceeding to another entry return; } };