Page MenuHomePhabricator

Prevent loading Gadget code for temporary accounts
Closed, DeclinedPublic

Description

Context

Currently, anonymous users cannot use MediaWiki-extensions-Gadgets, as these are available to logged-in users only. Temporary account users are logged-in, but will not be able to access their preferences to enable/disable Gadgets, including ones that are enabled by default on a given wiki (marked with default on e.g. https://www.mediawiki.org/w/index.php?title=MediaWiki:Gadgets-definition)

In BeforePageDisplay in GadgetHooks, we should check if the user is a temporary account, and if so, prevent loading the gadget code.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Default gadgets work for unregistered users, who have no way to turn them off either. Why should they not work for temporary accounts?

Default gadgets work for unregistered users, who have no way to turn them off either. Why should they not work for temporary accounts?

Ah, I misunderstood. I didn't realize that default gadgets were enabled fro anonymous users. From the extension page:

Enable the gadget by default for everyone (including IPs). Registered users can still disable it in their preferences.

In that case, we don't need to do anything here.