API Question

Creating and modifying plugins.
Post Reply
boelkstoff
Regular
Posts: 19
Joined: Wed Feb 02, 2005 9:46 pm

API Question

Post by boelkstoff » Tue Feb 08, 2005 3:26 pm

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.

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: API Question

Post by garvinhicking » Wed Feb 09, 2005 1:27 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Post Reply