Help with users and permissions?

Having trouble installing serendipity?
Post Reply
Robert Sanders

Help with users and permissions?

Post by Robert Sanders »

Hello,

I've been playing with serendipity and plug ins all day. Whats the magic combo to allow users to self sign up, but only submit entries? Right now, the closest I can get gives them access to Polls and other places I don't want them.

Thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Help with users and permissions?

Post by garvinhicking »

Sadly there is a problem with older plugins (like the polling) which does not have a specific usermanagement to restrict users.

Your best choice would be to create a usergroup with only rights to create entries. Then install the "User Self-Registration" plugin (event and sidebar) and set up the plugin to use the usergroup you created. And set them up to just be "Editors" and not Chief-Editors or Admins.

Then you'll need to tell me which plugins (like polls) show up in your admin panel, and I'll try to find a way to block it from non-editor users.

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/
Robert Sanders

Post by Robert Sanders »

Thanks!

That is exactly what I have done already.

Polls show up, RSS aggretor, cached entry

If you can get me a good rundown on one or two I can hack the rest i bet. I had a feeling I would need to do exactly that, but looking at the code is confusing at first. I am _not_ a programmer, but I can hack what I need into shape ;)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Robert!

Patching the code is actually quite easy. Just open the plugin file of the one that's causing the display, and look for a code like:

Code: Select all

                case 'backend_sidebar_entries':
                    echo '<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=poll">' . PLUGIN_POLL_TITLE . '</a></li>';
                    return true;
                    break;
just change that to:

Code: Select all

                case 'backend_sidebar_entries':
                    if ($serendipity['userlevel'] >= USERLEVEL_CHIEF) {
                        echo '<li><a href="?serendipity[adminModule]=event_display&serendipity[adminAction]=poll">' . PLUGIN_POLL_TITLE . '</a></li>';
                    }
                    return true;
                    break;
So you just add that IF statement to check the userlevel. I've just committed new versions of aggregator and pollbox plugins to support this.

The entryproperties plugin of serendipity nightlies already supports that check, BTW [the cached entries item].

HTH,
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/
Robert Sanders

Post by Robert Sanders »

Hello,

This statement never returns true for me (loged in as admin, cannot see link)
Serendipity 0.9.1 and PHP 4.4.1
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Are you sure your userlevel is "Admin"? Remember that the userlevel is not related to the userGROUP you are in!

What does $serendipity['userlevel'] contain in your statement case?

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