Page MenuHomePhabricator

Update UploadWizard for IP Masking
Closed, ResolvedPublic

Description

IP Masking means that we create a temporary account for any user that's editing without being logged in. More details on how temporary accounts work here, and more details on what to look for when adapting an extension to handle temporary accounts is here

A quick search for relevant code in the UploadWizard extension is here

We'll need to change isRegistered, find where the code checks if a user is logged in so they can upload and make sure only real logged-in users can upload, and then test everything to make sure it still works when logged in as a temp user or a regular user or not logged in at all.

To enable temporary accounts in your local dev env, add this to LocalSettings.php

$wgAutoCreateTempUser['enabled'] = true;

Details

Related Changes in Gerrit:

Event Timeline

Change 937103 had a related patch set uploaded (by Cparle; author: Cparle):

[mediawiki/extensions/UploadWizard@master] IP masking update

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

Minor change for campaigns in the patch above, which is probably all that needs to be done for UploadWizard

However ... atm if you're using a temporary account and you navigate to Special:UploadWizard or Special:Upload you get a page with a message saying:

You do not have permission to upload this file, for the following reason: The action you have requested is limited to users in one of the groups: Users, Administrators."

If you're anonymous you get a message saying:

Please log in to upload files.

I think it makes more sense for temp users to get the 2nd message rather than the first, but the code that does this is in core (see here) rather than UploadWizard. Currently discussing with @Tchanders

Above comment addressed by T341600, so I think this patch is all we need for UploadWizard

Change 937103 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] IP masking update

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

The message on commons beta for temp users is slightly different from the message for anon users on commons wmf.27:

commons betacommons wmf.27
"You must be logged in to upload files."
Screen Shot 2023-09-22 at 3.07.21 PM.png (900×3 px, 205 KB)
"Please log in to upload files."
Screen Shot 2023-09-22 at 3.07.14 PM.png (672×2 px, 118 KB)

@Cormac - a very minor point: should the message on commons beta be changed to "Please log in to upload files." as on production commons wiki? On the other hand, https://en.wikipedia.org/wiki/Special:Upload has 'You must be logged in to upload files.' which is consistent with commons beta wiki.

Closing as Resolved (will be tested in production as part of T341839: [QA task] IP masking - temp users testing in production).