Page 1 of 1

admin mode

Posted: Wed May 31, 2006 4:54 pm
by Timbalu
In some of my additional plugins s9y-0.9 I used things like this

Code: Select all

if ($_SESSION['serendipityAuthedUser'] === true) {
to determine admin mode.

It seems I can't use this in 1.1 any more (at least in wrap_url plugin pages)

Is there something similar to have restricted access to admin - and in diff - to authors?

I would like to include an admin section viewable only for s9y admin. It would be nice to include the stuff into serendipty_admin but I don't know how to do....

Regards,
Ian

Re: admin mode

Posted: Wed May 31, 2006 5:08 pm
by garvinhicking
Hi!

What exactly do you want to detect?

With your snippet you check if a user is logged in (no matter frontend/backend), and this still works.

If a user is an Admin can be checked through serendipity_checkPermission('siteConfiguration') or other permission items.

Best regards,
Garvin

Posted: Wed May 31, 2006 5:53 pm
by Timbalu
Hi Garvin

I am including some myadmin.php pages through a wrap_url plugin, while I am not able to have them inside serendipity admin framework.

Inside those pages I tried to use something like
if ($_SESSION['serendipityAuthedUser'] === true ) {
do this secret work
elseif is trusted user
do that
else
piss off

This did not work (the middle sec would just be finetuning).
Thats why I asked if there are better ways to do this.

Posted: Thu Jun 01, 2006 10:18 am
by garvinhicking
Hi!

The userlevel is AFAIR also stored in the session array, $_SESSION['serendipityUserlevel'].

Regards,
Garvin