Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

How to get logged-in user?

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


Jan at bytesmiths

Nov 18, 2009, 5:00 PM

Post #1 of 6 (987 views)
Permalink
How to get logged-in user?

I would like to use Parser Functions together with the current logged
in user to have conditional output from within <sql2wiki> tags, so
that logged-in users get to see things that anonymous users can't see.

Ideally, I'd like to get the mw_user.user_id integer, as I'm using
that as a primary key into an extended user information table.

I did crawl around meta.wikimedia.org (including Help:Variable, Help:Magic
, etc.) looking for this, to no avail.

Can someone point me in the right direction? Thanks!

:::: Political language -- and with variations this is true of all
political parties, from Conservatives to Anarchists -- is designed to
make lies sound truthful and murder respectable, and to give an
appearance of solidity to pure wind. -- George Orwell ::::
:::: Jan Steinman http://www.EcoReality.org ::::



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


p858snake at yahoo

Nov 18, 2009, 5:32 PM

Post #2 of 6 (906 views)
Permalink
Re: How to get logged-in user? [In reply to]

On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan [at] bytesmiths> wrote:
>
Are you using any sort of cahceing, because that would just plain break it?

-Peachey

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Jan at Bytesmiths

Nov 19, 2009, 9:40 AM

Post #3 of 6 (900 views)
Permalink
Re: How to get logged-in user? [In reply to]

> From: "K. Peachey" <p858snake [at] yahoo>
>
> On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan [at] bytesmiths>
> 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> ::::



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Nov 19, 2009, 1:33 PM

Post #4 of 6 (899 views)
Permalink
Re: How to get logged-in user? [In reply to]

Jan Steinman wrote:
>> From: "K. Peachey" <p858snake [at] yahoo>
>>
>> On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan [at] bytesmiths>
>> 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


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Jan at Bytesmiths

Nov 19, 2009, 4:50 PM

Post #5 of 6 (900 views)
Permalink
Re: How to get logged-in user? [In reply to]

On 19 Nov 09, at 13:34, mediawiki-l-request [at] lists wrote:

> From: Platonides <Platonides [at] gmail>
>
> Jan Steinman wrote:
>>> From: "K. Peachey" <p858snake [at] yahoo>
>>>
>>> On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan [at] bytesmiths>
>>> 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> ::::




_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Jan at Bytesmiths

Nov 20, 2009, 8:52 AM

Post #6 of 6 (889 views)
Permalink
Re: How to get logged-in user? [In reply to]

On 19 Nov 09, at 16:50, Jan Steinman wrote:

> On 19 Nov 09, at 13:34, mediawiki-l-request [at] lists wrote:
>
>> From: Platonides <Platonides [at] gmail>
>>
>> Jan Steinman wrote:
>>>> From: "K. Peachey" <p858snake [at] yahoo>
>>>>
>>>> On Thu, Nov 19, 2009 at 11:00 AM, Jan Steinman <Jan [at] bytesmiths>
>>>> 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...


Thanks again, and I found a perfect place to put this stuff so I don't
have to cobble up an extension from scratch.
http://www.mediawiki.org/wiki/Extension:Variables

This extension is pretty cool. It will basically let you define new
"magic words" as needed from anything that is available in the PHP
environment.
http://www.mediawiki.org/wiki/Help:Magic_words

:::: Having the last word is the final refuge for those who never had
a good point in the first place. ::::
:::: Jan Steinman http://www.VeggieVanGogh.com ::::



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.