Page MenuHomePhabricator

Prepare Collection extension for IP Masking
Closed, ResolvedPublic

Description

A preliminary investigation (T326759) has found that the Collection extension may be affected by IP Masking

Event Timeline

Amdrel changed the task status from Open to In Progress.Jul 29 2024, 11:10 PM
Amdrel claimed this task.

Change #1059172 had a related patch set uploaded (by Amdrel; author: Amdrel):

[mediawiki/extensions/Collection@master] Treat temporary users like anonymous users

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

I've attached a patch that adjusts the behavior of the '$wgCollectionPortletForLoggedInUsersOnly' variable to treat temporary accounts just like anonymous accounts. Collections already cannot be saved even when enabled for all users, just like anonymous users, so I didn't need to update that part.

Testing Instructions

The following configuration was used for this test.

$wgCollectionPortletForLoggedInUsersOnly = true;
$wgGroupPermissions['user']['collectionsaveascommunitypage'] = true;
$wgGroupPermissions['user']['collectionsaveasuserpage'] = true;

Steps

Page Tools
  1. Enable temporary accounts and make an edit on the wiki to get an account.
  2. Confirm that the 'Print/export' menu in the tools section does not render.
  3. Confirm that toggling $wgCollectionPortletForLoggedInUsersOnly to false allows the section render for temporary accounts.
Book Creator
  1. Navigate to /wiki/Special:Book with the temporary account.
  2. Confirm that the 'Save and share your book' section does not render.
  3. Log into any named user account (e.g. Admin) and navigate to /wiki/Special:Book again.
  4. Confirm that the 'Save and share your book' section appears for named accounts.

Change #1059172 merged by jenkins-bot:

[mediawiki/extensions/Collection@master] Treat temporary users like anonymous users

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

Djackson-ctr subscribed.

I have verified the new code has been implemented and is functioning, and displaying as expected (Per the Testing Instructions)...
Thank you for the Testing Instructions @Amdrel.