Page 1 of 1

Static pages, user groups, and adminEntriesMaintainOthers

Posted: Sun Mar 11, 2007 7:31 am
by jdfalk
I've been experimenting a bit, and couldn't find a way to allow the Chief Editor user group to edit other users' static pages. They're able to edit each others' regular entries, and they can create new static pages, but anyone else's static pages just don't show up in the drop-down menu -- even when I enabled adminPluginsMaintainOthers.

Is there a setting similar to adminEntriesMaintainOthers that applies to static pages? Or, any advice on how I can hack that in? I don't know PHP at all, but I can usually muddle my way through most scripting languages with the help of a good search engine and a few pointers.

Re: Static pages, user groups, and adminEntriesMaintainOther

Posted: Sun Mar 11, 2007 1:56 pm
by garvinhicking
Hi!

Sadly the current version of the staticpage plugin doesn't have its own usermanagement, and relies on what serendipity had before: The userlevels.

Before group management was added to s9y, a user could only be Editor, Chief Editor or Admin.

The staticpage plugin only allows people to edit staticpages if:

1. They are an 'Admin' userlevel author.
2. They are the static page owner
3. The editing users userlevel is higher than the static page owner.

That means, a Chief Editor can edit another Editor's static pages, but he cannot edit another Chief Editors pages.

You could patch that in the serendipity_event_staticpage.php file. Luckily, this check is at a singular place:

Code: Select all

    function checkUser(&$user)
    {
        global $serendipity;

        return (($user['userlevel'] < $serendipity['serendipityUserlevel']) || ($user['authorid'] == $serendipity['authorid']) || ($serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN));
    }
If you change this to:

Code: Select all

    function checkUser(&$user)
    {
        global $serendipity;

        return (($user['userlevel'] <= $serendipity['serendipityUserlevel']) || ($user['authorid'] == $serendipity['authorid']) || ($serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN));
    }
(note that one '<' became '<=') you will then be able that a chief editor can edit another chief editors pages. BUT also now editor users can access other editor users staticpages.


HTH,
Garvin