[Mediawiki-l] $user->isLoggedIn()

Jim Hu jimhu at tamu.edu
Fri Aug 31 20:00:16 UTC 2007


Spoke too soon.  The test script responds to being logged in or  
logged out, but calling it from a different script using  
file_get_contents isn't working.


On Aug 31, 2007, at 2:28 PM, Jim Hu wrote:

> It looks like detecting login may be even easier.  I'm seeing stuff
> in $_REQUEST that may work without even adding scripts to the wiki.
>
> JH
>
> On Aug 31, 2007, at 2:20 PM, Jim Hu wrote:
>
>> On Aug 31, 2007, at 2:09 PM, Minute Electron wrote:
>>
>>> On 8/31/07, Jim Hu <jimhu at tamu.edu> wrote:
>>>>  From what I can tell, $user->isLoggedIn() tells whether a user
>>>>
>>
>> <snip>
>>> All users regardless of whether they are logged in or not have a  
>>> user
>>> ID (anonymous == user id 0) so the only check that needs to be
>>> made is
>>> whether the user id is a positive integer.
>>
>>  From what I can tell, $user->isLoggedIn returns the userid in the
>> database, but
>> $_SESSION['wsUserID'] behaves as you describe, changing from 0 to 1
>> and back when I log in or out.
>> Interestingly, it seems to not care if I'm viewing the wiki from
>> different browsers, while MW itself recognizes them as different
>> sessions.  I think I can live with that.
>>
>> Now I just have to get the blog to be able to send a logout to both
>> itself and the wiki, which I'm guessing I can do by overwriting
>> $_SESSION['wsUserID'].
>>
>> Thanks!
>>
>> JH
>>
>>>
>>> -- 
>>> MinuteElectron.
>>> http://my.brlcad.org/~MinuteElectron/
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l at lists.wikimedia.org
>>> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>> =====================================
>> Jim Hu
>> Associate Professor
>> Dept. of Biochemistry and Biophysics
>> 2128 TAMU
>> Texas A&M Univ.
>> College Station, TX 77843-2128
>> 979-862-4054
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l at lists.wikimedia.org
>> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
> =====================================
> Jim Hu
> Associate Professor
> Dept. of Biochemistry and Biophysics
> 2128 TAMU
> Texas A&M Univ.
> College Station, TX 77843-2128
> 979-862-4054
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

=====================================
Jim Hu
Associate Professor
Dept. of Biochemistry and Biophysics
2128 TAMU
Texas A&M Univ.
College Station, TX 77843-2128
979-862-4054




More information about the MediaWiki-l mailing list