Page MenuHomePhabricator

Provide more informative block error message for Special:CreateAccount
Closed, ResolvedPublic1 Story Points

Description

The error shown to a user blocked from Special:CreateAccount is less informative than other block errors:

By comparison, block messages shown when attempting to edit an article or send an email give extra details, such as the block ID for looking up the block, expiry time and whether the block is partial or sitewide.

This error uses 'cantcreateaccount-range-text' for any blocks against an IP range, and 'cantcreateaccount-text' for any other blocks (including user/IP blocks, sitewide/partial blocks, system blocks, composite blocks, etc).

Problems with this:

  • This message assumes that there is a single user who made the block, which is not the case for system and composite blocks
  • If the target is not an IP range, this message assumes that it is an IP address, leading to the confusing phrasing: "Account creation from this IP address (Blockable) [...]"
  • The message does not contain information specific to the block type - e.g. reassurance that partially blocked users may be able to edit other pages

In other places where a block error is shown (e.g. on the edit page), the message is chosen from several possible messages, depending on various features of the block. The error shown here should use that logic too.

Details

Related Gerrit Patches:

Event Timeline

Tchanders created this task.Jul 2 2019, 4:15 PM
Restricted Application added subscribers: MGChecker, Aklapper. · View Herald TranscriptJul 2 2019, 4:15 PM

Assuming this task is about MediaWiki-User-login-and-signup and MediaWiki-User-management hence adding project tags so others can find this task under that projects.

Tchanders updated the task description. (Show Details)Oct 4 2019, 3:22 PM

Change 543875 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Provide a more informative message for authentication block errors

https://gerrit.wikimedia.org/r/543875

Niharika triaged this task as Medium priority.Oct 17 2019, 6:34 PM
Niharika set the point value for this task to 1.

Change 543875 merged by jenkins-bot:
[mediawiki/core@master] Provide a more informative message for authentication block errors

https://gerrit.wikimedia.org/r/543875

dom_walden added a subscriber: dom_walden.

Comparing https://en.wikipedia.beta.wmflabs.org to https://test.wikipedia.org.

AuthManager

Special:CreateAccount now shows the same block error message that you see when, for example, editing while blocked. Including start of block, block expiration, intended blockee and block id.

Same on Mobile as it is on Desktop.

Creating an account via the API also shows the type of block ("blocked", "autoblocked") and the block reason as it appears on Special:CreateAccount (including the HTML tags and wikitext).

I tested that it all gets appropriately translated into the user's language.

CheckBlocksSecondaryAuthenticationProvider

If your user is ipblock-exempt but your IP is blocked from account creation, Special:CreateAccount is accessible but you are blocked from creating an account (see T189362).

Now, the block error is the same as it is on Special:CreateAccount and editing.

The API query ?action=query&list=users&usprop=cancreate&ususers=$new_user, which uses CheckBlocksSecondaryAuthenticationProvider::testUserForCreation to check whether $new_user can be created. On test returns something like:

{
    "batchcomplete": "",
    "query": {
        "users": [
            {
                "name": "Nonexistentuser123",
                "missing": "",
                "cancreateerror": [
                    {
                        "message": "cantcreateaccount-text",
                        "params": [
                            "\u202a2001:8B0:7ACF:5D4E:22CF:30FF:FE4E:1D46\u202c",
                            "{{uw-vaublock}} <!-- Username violation, vandalism-only account -->: foobar [[foo|bar]] {{anon}}",
                            "\u202aDom walden\u202c"
                        ],
                        "code": "cantcreateaccount-text",
                        "type": "error"
                    }
                ]
            }
        ]
    }
}

On beta now returns something like:

{
    "batchcomplete": "",
    "query": {
        "users": [
            {
                "name": "Nonexistentuser123",
                "missing": "",
                "cancreateerror": [
                    {
                        "message": "autoblockedtext",
                        "params": [
                            "[[User:Dom walden|\u202aDom walden\u202c]]",
                            "[[Wikipedia:Autoblock|Autoblocked]] because your IP address was recently used by \"[[User:Drwpb|Drwpb]]\". The reason given for Drwpb's block is: \"{{checkuserblock}}: jklsd fjl {{checkblock}}\".",
                            "81.187.41.249",
                            "\u202aDom walden\u202c",
                            8104,
                            "12:31, 29 October 2019",
                            "81.187.41.249",
                            "12:31, 28 October 2019"
                        ],
                        "code": "autoblocked",
                        "type": "error"
                    }
                ]
            }
        ]
    }
}

The value of the "message" parameter changing depending whether it is a partial, sitewide or autoblock.

dbarratt closed this task as Resolved.Oct 28 2019, 5:46 PM