Page MenuHomePhabricator

Special:CreateAccount does not respect "Prevent account creation" from Special:BlockIP
Closed, ResolvedPublic

Description

Test case [[Special:BlockIP]]:

IP Address or username: any IP address
Expiry: whatever you like
Reason: ...

Other/additional reason:

  • Block anonymous users only
  • Prevent account creation
  • Automatically block the last IP address used by this user,...

Note that "Prevent account creation" is not marked!

When a user tries to register an account via [[Special:CreateAccount]] he get the standard block message even if "Prevent account creation" was not marked.


Version: 1.13.x
Severity: normal

Details

Reference
bz14698

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:13 PM
bzimport set Reference to bz14698.

This doesn't appear to be working the right way; it's finding that permission is not allowed, but then trying to ignore particular reasons why it might not be allowed.
Correct fix should be to ensure that the correct result is actually obtained from the permission check in the first place!
Note that the error key may have 'autoblocktext' for autoblocks, which would not match this check as written.

Reverted for now in r37002

dev wrote:

getUserPermissionsErrors Patch

Basically according to be debug logs, we are basically checking the block logs twice...

Once to work out if they have a block preventing account creation (correct) which is line 727 of SpecialUserlogin.php
Then again, when we check that the LocalSettings.php file doesn't have $wgGroupPermissions[*]['createaccount'] = false via getUserPermissionsErrors, which is line 730 of SpecialUserlogin.php, normally this makes sense, but it's blind to the prevent account creation flag so it's no good for us.

Simple solution is don't run block check in getUserPermissionsErrors if the action is createaccount.

Attached:

Keywords: patch, need-review
Assigned: brion, as he reverted the previous commit that fixed this issue.

*** This bug has been marked as a duplicate of bug 13611 ***