mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Skip auth checks when autocreate is allowed by provider
Session providers can provide a `canAlwaysAutocreate` flag which indicates account creation is exempt from autocreate permission checks. This is used, for example, for providers that provide users for supporting applications in a wiki farm. Check the flag and exempt the auto creation from abuse filter checks as well. Bug: T373778 Change-Id: Id89358930b92cb8dd05c2b031e764412ee641269
This commit is contained in:
parent
db67b31db2
commit
65c10f5fa0
|
@ -61,7 +61,7 @@ class AbuseFilterPreAuthenticationProvider extends AbstractPreAuthenticationProv
|
|||
*/
|
||||
public function testUserForCreation( $user, $autocreate, array $options = [] ): StatusValue {
|
||||
// if this is not an autocreation, testForAccountCreation already handled it
|
||||
if ( $autocreate ) {
|
||||
if ( $autocreate && !( $options['canAlwaysAutocreate'] ?? false ) ) {
|
||||
// Make sure to use an anon as the creator, see T272244
|
||||
return $this->testUser( $user, $this->userFactory->newAnonymous(), true );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue