[Mediawiki-l] How to get logged-in user?

Jan Steinman Jan at Bytesmiths.com
Fri Nov 20 00:50:30 UTC 2009


On 19 Nov 09, at 13:34, mediawiki-l-request at lists.wikimedia.org wrote:

> From: Platonides <Platonides at gmail.com>
>
> Jan Steinman wrote:
>>> From: "K. Peachey" <p858snake at yahoo.com.au>
>>>
>>> On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan at bytesmiths.com>
>>> wrote:
>>> Are you using any sort of cahceing, because that would just plain
>>> break it?
>>
>> No caching that I'm aware of beyond what MW does.
>>
>>
>> :::: The Earth isn't a pizza. You can't dial up and have one
>> delivered! -- Alf ::::
>> :::: Jan Steinman <http://www.EcoReality.org> ::::
>
> $wgUser->isLoggedIn() / $wgUser->getId()
>
> Default mediawiki caching will give you problems. You need to disable
> page caching on at least the pages which use your tag, by using
> $parser->disableCache()
> http://www.mediawiki.org/wiki/Extensions_FAQ#Recent_versions


Thanks, Platonides.

I do understand how to get the user from within PHP; I was hoping to  
get it from within wikitext.

I suppose I could write an extension that does nothing but answer the  
current user and their ID...

:::: Once a nation parts with the control of its curency and credit,  
it matters not who makes that nation's laws. — Mackenzie King ::::
:::: Jan Steinman, EcoReality <http://www.EcoReality.org> ::::






More information about the MediaWiki-l mailing list