Skip Menu |

This queue is for tickets about the MediaWiki CPAN distribution.

Report information
The Basics
Id: 28990
Status: new
Priority: 0/
Queue: MediaWiki

People
Owner: Nobody in particular
Requestors: TWILDE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.11
Fixed in: (no value)



Subject: Detect Logged In Username On Edits
When loading a page for edit, it is possible to load the current logged in username (if there is one) by looking at the JavaScript generated by MediaWiki, in the wgUserName variable. This is very useful to me, and I've made a one-line patch that adds it as a page variable when a page is loaded rw: Index: page.pm =================================================================== --- page.pm (revision 123) +++ page.pm (working copy) @@ -251,6 +251,7 @@ $obj->{content} = $a; $obj->{exists} = 1; + ($obj->{loggedinuser}) = $t =~ m/var wgUserName = "(.*?)"/; } $obj->prepare_update_tokens($t); return; It may make sense to do something with this in MediaWiki.pm as well, updating the object's internal state if it is determined that the user is no longer logged in. I'm not sure if this is easy or not, though, so it may be best left up to an application-level thing. Thanks, Tim