Page MenuHomePhabricator

Update requireLogin() for temp users on ContactPage extension
Closed, ResolvedPublic

Description

In T344276, we want to make sure the SpecialPage::requireLogin is used in accordance with the introduction of temporary users. As for now, we want to treat temporary users just like anonymous or IP users.

Request:
Does the ::requireLogin call mean that users must be logged into a named account?

  • If yes, ::requireNamedUser should be used
  • If not, no change is needed.

Notes:
RequireLogin was found in the following files:
includes/SpecialContact.php
Code Search Link

QA Results - Local

Event Timeline

@AGueyte I've not been able to find the file includes/Special/SpecialContentTranslation.php in the ContactPage extension. The usage from codesearch seems to be in includes/SpecialContact.php.

Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz updated the task description. (Show Details)

@AGueyte I've not been able to find the file includes/Special/SpecialContentTranslation.php in the ContactPage extension. The usage from codesearch seems to be in includes/SpecialContact.php.

Noted, thanks for the update.

The ContactPage extension allows forms to specify if they wish to require the user to be logged in. I believe that the intent of this is to require users to have an account. As such, I think this should be a call to ::requireNamedUser. A separate config to allow temporary accounts and named accounts, but not IPs could be added.

Change 951564 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ContactPage@master] Treat temporary users as logged out for MustBeLoggedIn config

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

AGueyte changed the task status from Open to In Progress.Sep 5 2023, 2:00 PM

Change 951564 merged by jenkins-bot:

[mediawiki/extensions/ContactPage@master] Treat temporary users as logged out for MustBeLoggedIn config

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

Assigning this to myself as I created the patch.

GMikesell-WMF subscribed.

@AGueyte Temp accounts are treated as not logged in when trying to access Special:Contact as seen in the gif. I will move this to Done. Thanks for all your work!

Status: ✅ PASS
Environment: Local: 1.41.0-alpha (3c881e4) 18:32, 12 September 2023.
OS: macOS Ventura
Browser: Chrome 116
Device: MBA M2
Emulated Device:: N/A
Test Links:
Special:Contact

✅AC1: https://phabricator.wikimedia.org/T344722

Logged InTemp Acct
2023-09-12_13-04-20.png (814×3 px, 521 KB)
2023-09-12_13-10-16.mp4.gif (698×3 px, 1 MB)