Page 1 of 1

API Question

Posted: Tue Feb 08, 2005 2:26 pm
by boelkstoff
Hello.
As you have probally notice I love s9y and the cool plugin system.
I am looking for a way to find out what user is currently logged in.
In another plugin I have found:

Code: Select all

$_SESSION['serendipityAuthedUser']
which tells me if a user is logged in.
How can I found out which user is logged in (userid) and what his rights are (e.g. 0 oer 255).

Why am I asking? Well I since my guestbook is almost done, I am thinking about an extendes user plugins which allows user to enter extra data like adress or phonenumber, which can other user view. I know this is not the purpose of a weblog, but I will probally need that in the future. So it would be nice.

Thanks
Phil

P.S. It would be nice if you would have a document (whcih can everybody edit, like the "who is using") , where someone can right down some api things that he/she found out, so other people can look and browse and do not need to ask the question again.

Re: API Question

Posted: Wed Feb 09, 2005 12:27 pm
by garvinhicking
Hi!

You can access

Code: Select all

$_SESSION['serendipityUser']
$_SESSION['serendipityUserlevel']
$_SESSION['serendipityAuthorid']
for that. Those are defined within include/functions_config.inc.php, function serendipity_authenticate_author().

So have fun with that, and great to hear you like Serendipity :-)

Basically our Wiki should support the creation of new documents within "User documentation", since that one is globally writeable. If it doesn't work, blame coWiki :-D

Regards,
Garvin