admin mode

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

admin mode

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: admin mode

Post 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
# 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/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

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

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