Last modified: 2014-09-24 01:11:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T34819, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32819 - Add "USERBLOCKED" magic word to MediaWiki core
Add "USERBLOCKED" magic word to MediaWiki core
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.mediawiki.org/wiki/Extens...
: easy
Depends on:
Blocks: 25380
  Show dependency treegraph
 
Reported: 2011-12-06 00:00 UTC by Ian Baker
Modified: 2014-09-24 01:11 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ian Baker 2011-12-06 00:00:33 UTC
InteractiveBlockMessage is a simple extension that adds a new magic word, "USERBLOCKED".  This returns true/false to indicate the blocked status of a user, when used in NS_USER or NS_TALK.  It allows for the creation of more user-friendly block templates.

It appears that the proposal is supported by the enwiki community: http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(proposals)#.22Blocked.22_template_tweak

Code's been reviewed, and looks good.  Here are the commits in question:
http://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki&path=%2Ftrunk%2Fextensions%2FInteractiveBlockMessage

The author of this extension is [[User:Petrb]]
Comment 1 Sam Reed (reedy) 2011-12-06 15:33:53 UTC
Note, said discussion hasn't concluded/been closed
Comment 2 Peter Bena 2011-12-12 12:56:19 UTC
it's closed now so you can deploy it. Thanks!
Comment 3 Bawolff (Brian Wolff) 2011-12-15 06:56:57 UTC
Thought I'd look over this extension and give some thoughts:


Line 28 of InteractiveBlockedMessage.php:
$wgAutoloadClasses['InteractiveBlockMessage'] = "$dir/InteractiveBlockMessage.php";

I'm not sure what that's about (It won't hurt anything, but there is no such class, so it probably shouldn't be there)

*LanguageGetMagic hook usage - That's probably ok, but if you use a .magic.i18n.php file, the magic word name can be translated at translatewiki (I think anyways)

*MagicWord id being all capitalized - Doesn't really matter, but the magic word id (not the actual magic word, just its internal id) are all lowercase for all the magic words in core

*$user->isBlocked() call - should perhaps pass a true to explicitly ask the result to come from slave (doesn't really matter though, since slave is default, but good to be explicit)

*Doesn't work on anon user pages (not sure if intentional or not. if it's wanted, all that needs to be done is pass false as second argument to user::newFromName) if it did work for anons, there might be security implications in revealing auto-blocks (As mentioned on the en wp page, although given the number of autoblocks in place at one time, it'd be difficult to glean much from this, but still not a good thing)

*If the user causes their own user page to be rendered, the magic word will report true if the user is blocked via auto-blocks, proxy auto-blocker, or DNSBL block (although I don't think the last two are used by wikimedia). This is inconsistent (Compared to other people rendering the page), and probably a bad thing (Although not horrible). Perhaps better to use Block::newFromTarget directly, in which case it would only look at explicit blocks (and could also be used on anon user pages without leaking auto-blocks).

*We should perhaps add a hook to SpecialUnblock::processUnblock so that this extension could explicitly purge user pages on an explicit unblock.

--
Cheers

-------
btw, does this extension still need review by the senior dev cabal? (I know there is a mailing list thread about that) if so, it should have the keyword "need-review" and be blocking bug 31235.
Comment 4 Bugmeister Bot 2011-12-15 15:11:18 UTC
Baowolff, you missed Bug 32128 which this bug should depend on.  I've pointed to your review there.
Comment 5 Bugmeister Bot 2011-12-15 15:20:16 UTC
(In reply to comment #4)
> Baowolff, you missed Bug 32128 which this bug should depend on.  I've pointed
> to your review there.

bleh.  Forget this. I screwed up.
Comment 6 Sumana Harihareswara 2012-04-04 13:50:00 UTC
Petr, please respond to these criticisms from bawolff.  Thanks.
Comment 7 MZMcBride 2012-04-05 05:53:25 UTC
English Wikipedia templates are copied to other wikis very often. I'm not sure adding an extension dependency is a good idea here. Is there a reason an extension was chosen rather than implementing this magic word in core?
Comment 8 Sam Reed (reedy) 2012-04-17 14:43:42 UTC
-shell as it's not ready for deploy
Comment 9 Sumana Harihareswara 2012-11-16 22:34:55 UTC
Petr, just pinging to see whether you have had time to look at the code critique. Thanks!
Comment 10 Andre Klapper 2013-01-23 13:10:27 UTC
Petr: Could you comment on comment 3 please?


https://www.mediawiki.org/wiki/Extension:InteractiveBlockMessage links to SVN (not converted to using Git yet so likely not actively developed?).
Comment 11 MZMcBride 2013-01-23 22:53:21 UTC
(In reply to comment #10)
> Petr: Could you comment on comment 3 please?

Comment 7 as well. :-)
Comment 12 Tim Starling 2013-02-04 00:24:16 UTC
I think this small (~30 lines) obscure templating feature should just be in the core.
Comment 13 Alex Monk 2013-02-04 00:26:22 UTC
(In reply to comment #10)
> Petr: Could you comment on comment 3 please?
> 
> 
> https://www.mediawiki.org/wiki/Extension:InteractiveBlockMessage links to SVN
> (not converted to using Git yet so likely not actively developed?).

Looks like it is in Git: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/InteractiveBlockMessage.git;a=summary
Comment 14 Peter Bena 2013-02-25 08:22:51 UTC
(In reply to comment #12)
> I think this small (~30 lines) obscure templating feature should just be in
> the
> core.

I would prefer to have core as small as possible and as fast as possible. But given the amount of mess that is already in core, I think that inserting some 30 lines more wouldn't hurt. So... I don't have problem with that.
Comment 15 MZMcBride 2013-02-25 08:31:32 UTC
Updating the bug summary to reflect the shift from deploying a particular MediaWiki extension (InteractiveBlockMessage) to Wikimedia wikis to putting this feature/functionality in MediaWiki core.

Marking this bug as "easy" as most of the code is already written, I believe, it just needs to be put into MediaWiki core in a Gerrit changeset.
Comment 16 Peter Bena 2013-02-25 08:34:27 UTC
(In reply to comment #3)
> Thought I'd look over this extension and give some thoughts:
> 
> 
> Line 28 of InteractiveBlockedMessage.php:
> $wgAutoloadClasses['InteractiveBlockMessage'] =
> "$dir/InteractiveBlockMessage.php";
> 
> I'm not sure what that's about (It won't hurt anything, but there is no such
> class, so it probably shouldn't be there)
> 

if it's not there, be bold and fix it. I am sure it was there in past.

> *LanguageGetMagic hook usage - That's probably ok, but if you use a
> .magic.i18n.php file, the magic word name can be translated at translatewiki
> (I
> think anyways)
> 

translating magic words? Nooooo please :) keep it compatible cross-language (magic words are already translated in Microsoft Excel and it's pain in the arse)

> *MagicWord id being all capitalized - Doesn't really matter, but the magic
> word
> id (not the actual magic word, just its internal id) are all lowercase for
> all
> the magic words in core
> 
> *$user->isBlocked() call - should perhaps pass a true to explicitly ask the
> result to come from slave (doesn't really matter though, since slave is
> default, but good to be explicit)
> 

so fix it.

> *Doesn't work on anon user pages (not sure if intentional or not. if it's
> wanted, all that needs to be done is pass false as second argument to
> user::newFromName) if it did work for anons, there might be security
> implications in revealing auto-blocks (As mentioned on the en wp page,
> although
> given the number of autoblocks in place at one time, it'd be difficult to
> glean
> much from this, but still not a good thing)
> 

well, the original purpose was to make block messages on anon pages less confusing. But given the incredible amount of bureaucracy on english wikipedia, who knows if it's even possible since the question "am I even allowed to edit wikipedia" is TOP SECRET now.

> *If the user causes their own user page to be rendered, the magic word will
> report true if the user is blocked via auto-blocks, proxy auto-blocker, or
> DNSBL block (although I don't think the last two are used by wikimedia). This
> is inconsistent (Compared to other people rendering the page), and probably a
> bad thing (Although not horrible). Perhaps better to use Block::newFromTarget
> directly, in which case it would only look at explicit blocks (and could also
> be used on anon user pages without leaking auto-blocks).
> 
> *We should perhaps add a hook to SpecialUnblock::processUnblock so that this
> extension could explicitly purge user pages on an explicit unblock.
> 

let's fix it

> --
> Cheers
> 
> -------
> btw, does this extension still need review by the senior dev cabal? (I know
> there is a mailing list thread about that) if so, it should have the keyword
> "need-review" and be blocking bug 31235.
Comment 17 MZMcBride 2013-04-22 23:11:17 UTC
This extension should not be deployed. The feature is reasonable for MediaWiki core, though.
Comment 18 Greg Grossmeier 2013-08-29 18:32:02 UTC
Removing the blocks bug 31235 as this is no longer about deploying an extension. Feel free to reblock that tracking bug if it switches back.
Comment 19 Technical 13 2013-11-29 18:14:50 UTC
The blocks were removed and yet this has been sitting here for months... Adding myself to cc list and making a comment to bump this and move it forward (perhaps).
Comment 20 TeleComNasSprVen 2014-04-24 04:14:54 UTC
I think bug 25380 is a similar, related request, except that magic word can take a parameter after the colon. Is there any other difference between these two?
Comment 21 Gerrit Notification Bot 2014-05-16 23:34:31 UTC
Change 133661 had a related patch set uploaded by Withoutaname:
Add new ParserFunction "USERBLOCKED"

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links