Security Advice needed, re: Group vs Category

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Security Advice needed, re: Group vs Category

Post by garvinhicking »

Don Chambers wrote:Did you activate the smarty option in the category plugin? It is the last option for the plugin labeled "Enable Smarty-Templates? "
Oh Don. You're surely absolutely right. Glad you thought about this one! :)

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/
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Re: Security Advice needed, re: Group vs Category

Post by Stosh »

Garvin, Don...

It worked !

I had Smarty templates shut off, turned it back on... That's all it took.

The catdepth variable, turns out to be origin-0 (php, apparently is inspired by perl :) )

Here's the code

Code: Select all

    <ul id="serendipity_categories_list" style="list-style: none; margin: 0px; padding: 0px">
        <li> What is this now?</li>
{foreach from=$categories item="plugin_category"}
    {if $plugin_category.catdepth < 1 }
        <li class="category_depth{$plugin_category.catdepth} category_{$plugin_category.categoryid}" style="display: block;">
        {if $is_form}    
            <input style="width: 15px" type="checkbox" name="serendipity[multiCat][]" value="{$plugin_category.categoryid}" />
        {/if}
    
        {if !empty($category_image)}
            <a class="serendipity_xml_icon" href="{$plugin_category.feedCategoryURL}"><img src="{$category_image}" alt="XML" style="border: 0px" /></a>
        {/if}

            <a href="{$plugin_category.categoryURL}" title="{$plugin_category.category_description|escape}" style="padding-left: {$plugin_category.paddingPx}px">{$plugin_category.category_name|escape}</a>
        </li>

    {/if}


{/foreach}
    </ul>
This include my debug line (what is this now). The test for < 1 gives just the top-level categories.

THANK YOU !

-stosh
Last edited by Stosh on Thu Jun 17, 2010 11:18 pm, edited 1 time in total.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Security Advice needed, re: Group vs Category

Post by Don Chambers »

@ John - glad to hear it worked out. The symptoms just sounded to me like the option was not enabled. Lucky for you, I actually did a custom category template once upon a time or I would have never thought about it.

@ Garvin - does this mean I won a t-shirt? Coffee cup? Pen? Round trip ticket to DE so I can meet some of the EU S9Y developers? I have never done Rock Band, but I think I can handle it if I have to! I'll have Judebert on bass!! :lol:
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Security Advice needed, re: Group vs Category

Post by garvinhicking »

Hi Don!

Well, if you can arrange a sleepover in the same room like our cat, there's always a place if you happen to visit cologne! :)

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/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Security Advice needed, re: Group vs Category

Post by Don Chambers »

garvinhicking wrote:Hi Don!

Well, if you can arrange a sleepover in the same room like our cat, there's always a place if you happen to visit cologne! :)

Regards,
Garvin
I love cats..... they taste like chicken!!! :lol: :lol: :lol:
=Don=
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Re: Security Advice needed, re: Group vs Category

Post by Stosh »

re: "I love cats..... they taste like chicken!!!"

True cat-lovers know that they're often thinking the same thing when they look at their masters.

-stosh
Last edited by Stosh on Thu Jun 17, 2010 11:17 pm, edited 1 time in total.
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Tags for content, Categories for security?

Post by Stosh »

Hello again.

Just to bring this older topic up to date. I was wondering how to use the categories for both context and for security, and was having trouble coming up with a security-strategy in the face of the overloaded category (responsible for both security and context).

With a lot of help from you, we came up with a strategy that works fine: Use the top-level categories for context, and the next level down for access. i.e.,
  • Red things (open to all access)
    • L0010-Red things (restricted access)
    • L0100-Red things (more restricted access)
    • etc.
  • Blue things
So, this works fine. But now I've started messing with the tag thingy. I'm thinking it may work even better to use the categories for access categories, and use the tags for context categories. If this works I can even get rid of the special-code that only displays the top-level categories in the index.

Couple of questions:

1. I'm just getting started with the tag plugin. Do you see any pitfalls or unintended consequences to using Categories exclusively for security access groups, while using tags for context categories?

2. What is a leaf tag? As far as I can tell, it's just a tag that only has one entry at the present moment? No?

Thanks for your help.

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

Re: Tags for content, Categories for security?

Post by garvinhicking »

Hi!

That should work, I think. Categories make it a bit easier to use with Template coding; the output of the freetag plugin is a bit harder to manipulate. But I would definitely check it out in your setup.
2. What is a leaf tag? As far as I can tell, it's just a tag that only has one entry at the present moment? No?
Exactly. :)

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