Hi,
I am setting up a multi-user blog where each user has his own category and should be able to post only in his category.
I have setup the appropriate users, groups and categories and set their permissions. The problem is that every user can still create uncategorized entries. How can I prevent this so that users can post ONLY in their category?
Thanks.
categories and permissions
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: categories and permissions
Hi!
You can install the plugin 'entrycheck' which allows you to set up Rules for Publishing, like that no posting in an unassociated category can happen.
Best regards,
Garvin
You can install the plugin 'entrycheck' which allows you to set up Rules for Publishing, like that no posting in an unassociated category can happen.
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/
# 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/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Hm, I believe there is a plugin that deals with 'default categories', but I can't remember which one![Smile :)](./images/smilies/icon_smile.gif)
But with a little bit of PHP code it would not be too hard to set that...if you remember me about it tomorrow I could try to come up with such a thing. But I'd only code that if you really need it![Wink ;)](./images/smilies/icon_wink.gif)
Best regards,
Garvin
Hm, I believe there is a plugin that deals with 'default categories', but I can't remember which one
![Smile :)](./images/smilies/icon_smile.gif)
But with a little bit of PHP code it would not be too hard to set that...if you remember me about it tomorrow I could try to come up with such a thing. But I'd only code that if you really need it
![Wink ;)](./images/smilies/icon_wink.gif)
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/
# 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/
Well, I've actually been wanting to get into serendipity development, and this seemed like a good time to jump into the code.
I've had a look at the db structure and the code that makes the entry screen work, but I don't really see an intuitive way of assigning a default category for the group. Adding a default-category property to serendipity_groupconfig was my first thought, but those are mostly boolean values, which appear to be queried using the serendipity_checkPermission function. I could instead add a default-entry-category column to the serendipity_groups table but I'm not sure whether that is a good idea.
So now I ask, how would you do it?
As an aside, I did find a very simple and dirty solution to satisfy both my no-uncategorized-entries requirement, and my desire to default new entries to something besides [No Category]. By simply commenting out the 'No Category' from the category list in functions_entries_admin.inc.php, I prevent un-categorized entries, and get a default selected category in which the user has permission to post.
However, I wouldn't be surprised if this dirty fix breaks something else.
I've had a look at the db structure and the code that makes the entry screen work, but I don't really see an intuitive way of assigning a default category for the group. Adding a default-category property to serendipity_groupconfig was my first thought, but those are mostly boolean values, which appear to be queried using the serendipity_checkPermission function. I could instead add a default-entry-category column to the serendipity_groups table but I'm not sure whether that is a good idea.
So now I ask, how would you do it?
As an aside, I did find a very simple and dirty solution to satisfy both my no-uncategorized-entries requirement, and my desire to default new entries to something besides [No Category]. By simply commenting out the 'No Category' from the category list in functions_entries_admin.inc.php, I prevent un-categorized entries, and get a default selected category in which the user has permission to post.
![Smile :)](./images/smilies/icon_smile.gif)
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Great, your eagerness should be awarded.![Smile :)](./images/smilies/icon_smile.gif)
Let's see how I would do that: I would add the default posting category to the "personal preferences". That would simply add a "defaultcat" propery to the array that is defined in include/tpl/config_personal.inc.php.
That is then automatically assigned as $serendipity['defaultcat'] which you can use in the include/functions_entries_admin.inc.php entry form function.
Best regards,
Garvin
Great, your eagerness should be awarded.
![Smile :)](./images/smilies/icon_smile.gif)
Let's see how I would do that: I would add the default posting category to the "personal preferences". That would simply add a "defaultcat" propery to the array that is defined in include/tpl/config_personal.inc.php.
That is then automatically assigned as $serendipity['defaultcat'] which you can use in the include/functions_entries_admin.inc.php entry form function.
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/
# 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/