Check User's Group in Theme

5 views
Skip to first unread message

Phil -- wbtc.fr --

unread,
May 24, 2010, 4:37:48 PM5/24/10
to in-por...@googlegroups.com
Hello,

how could I use a conditionnal check to display elements only for a given group, like permissions does for categories?
Something like  <inp2:m_RequireLogin  with  group_id="x" ...

Thanks
Phil.

Dmitry Andrejev

unread,
May 24, 2010, 5:07:33 PM5/24/10
to in-por...@googlegroups.com
<inp2:m_RequireLogin group="ID,ID2" next_template="..."/>

Phil -- wbtc.fr --

unread,
May 24, 2010, 5:34:45 PM5/24/10
to in-por...@googlegroups.com
thanks !

2010/5/24 Dmitry Andrejev <dand...@gmail.com>

Phil -- wbtc.fr --

unread,
May 25, 2010, 7:13:43 PM5/25/10
to in-por...@googlegroups.com
Sorry, my question was not very well asked, as I realize a also need to know if it's possible to have a conditionnal check for user group, to make appearing (or not) selected elements in a page, something like

<inp2:m_if check="u_UserGroup" group="13">

I've made different tests but... no success :s


2010/5/24 Phil -- wbtc.fr -- <ph...@wbtc.fr>

Dmitry Andrejev

unread,
May 25, 2010, 7:44:45 PM5/25/10
to in-por...@googlegroups.com
Post the whole block of your template plz.

Phil -- wbtc.fr --

unread,
May 26, 2010, 5:53:04 AM5/26/10
to in-por...@googlegroups.com
Hello,

I want to display particular fields in suggest_link.tpl, depending the user's group, that's why I want to check the group and display -or not- some of the form's fields. I'll need to apply the same system to modify_link.tpl.

thanks
Phil.

PS: I tried to create a different suggest_link template, but it's not  recognized by the system, or I don't know how to do so ^-^

2010/5/26 Dmitry Andrejev <dand...@gmail.com>

Alexander Obuhovich

unread,
May 26, 2010, 5:58:24 AM5/26/10
to in-por...@googlegroups.com
There no such tag. But it's really easy to write one, like <inp2:m_if check="m_HasUserGroup" group="11">...</inp2:m_if>



On Wed, May 26, 2010 at 12:53 PM, Phil -- wbtc.fr -- <ph...@wbtc.fr> wrote:
Hello,

I want to display particular fields in suggest_link.tpl, depending the user's group, that's why I want to check the group and display -or not- some of the form's fields. I'll need to apply the same system to modify_link.tpl.

thanks
Phil.

PS: I tried to create a different suggest_link template, but it's not  recognized by the system, or I don't know how to do so ^-^

2010/5/26 Dmitry Andrejev <dand...@gmail.com>

Post the whole block of your template plz.


On Tue, May 25, 2010 at 6:13 PM, Phil -- wbtc.fr -- <ph...@wbtc.fr> wrote:
Sorry, my question was not very well asked, as I realize a also need to know if it's possible to have a conditionnal check for user group, to make appearing (or not) selected elements in a page, something like

<inp2:m_if check="u_UserGroup" group="13">

I've made different tests but... no success :s


2010/5/24 Phil -- wbtc.fr -- <ph...@wbtc.fr>

thanks !

2010/5/24 Dmitry Andrejev <dand...@gmail.com>

<inp2:m_RequireLogin group="ID,ID2" next_template="..."/>


On Mon, May 24, 2010 at 3:37 PM, Phil -- wbtc.fr -- <ph...@wbtc.fr> wrote:
Hello,

how could I use a conditionnal check to display elements only for a given group, like permissions does for categories?
Something like  <inp2:m_RequireLogin  with  group_id="x" ...

Thanks
Phil.








--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Phil -- wbtc.fr --

unread,
May 26, 2010, 6:04:11 AM5/26/10
to in-por...@googlegroups.com
Thank for you answer Alex, when you say "like", it means I should adapt it? :$

I have Tag HasUserGroup Undefined in kmaintagprocessor[Agregated Tag]: HasUserGroup

2010/5/26 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
May 26, 2010, 6:05:37 AM5/26/10
to in-por...@googlegroups.com
No, I mean we could write one. We don't have one.

Phil -- wbtc.fr --

unread,
May 26, 2010, 6:27:15 AM5/26/10
to in-por...@googlegroups.com
oh, ok... well, this would help me a lot!
It could be usefull also for other projects, don't you think so?

2010/5/26 Alexander Obuhovich <aik....@gmail.com>

Phil -- wbtc.fr --

unread,
May 26, 2010, 11:40:13 AM5/26/10
to in-por...@googlegroups.com
Don't we have a similar system to manage menus displaying upon group permissions?

2010/5/26 Phil -- wbtc.fr -- <ph...@wbtc.fr>

Alexander Obuhovich

unread,
May 26, 2010, 2:50:45 PM5/26/10
to in-por...@googlegroups.com
Group permission, yes. You could give users from that group specific permission and check it later on front-end.

Phil -- wbtc.fr --

unread,
May 26, 2010, 4:36:10 PM5/26/10
to in-por...@googlegroups.com
well, how to check group permission in an other way than using groud ID?
How to make information displaying or not, depending of the user's group?

2010/5/26 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
May 27, 2010, 5:24:05 AM5/27/10
to in-por...@googlegroups.com
You need to learn PHP then. Since there is no way to check something group based for now, except for existing group permissions.

You could suggest that new m_HasGroup tag as a feature. Maybe it will even be placed into 5.1.0-B2.

Phil -- wbtc.fr --

unread,
May 27, 2010, 5:47:39 AM5/27/10
to in-por...@googlegroups.com
well, I suggest this feature, another good feature for big projects.

Being able to permit to adapt members's page content according to their membership level, using a tag like :


<inp2:m_if check="m_HasUserGroup" group="11">...</inp2:m_if>

ps: Alex, I would really like to learn PHP, but... I don't have the magic formula to extend days ;-) it's planned for later... Actually I learn by myself how to use and maintain openERP, the best competitor to SAP, and may we should think about a module for this enterprise class ERP...)

Alexander Obuhovich

unread,
May 27, 2010, 7:47:56 AM5/27/10
to in-por...@googlegroups.com
Please create task then & place link to it here.

Phil -- wbtc.fr --

unread,
May 27, 2010, 11:20:16 AM5/27/10
to in-por...@googlegroups.com
sorry I forgot I can do it myself :$

here is the task : http://tracker.in-portal.org/view.php?id=750

2010/5/27 Alexander Obuhovich <aik....@gmail.com>

Dmitry A.

unread,
May 30, 2010, 6:50:03 PM5/30/10
to In-Portal Development Team
Hi Phil,


Sorry for going back, but can you provide a good example (or better 2)
where you'll be using this tag?


Thanks.

DA.

On May 27, 10:20 am, "Phil -- wbtc.fr --" <p...@wbtc.fr> wrote:
> sorry I forgot I can do it myself :$
>
> here is the task :http://tracker.in-portal.org/view.php?id=750
>
> 2010/5/27 Alexander Obuhovich <aik.b...@gmail.com>
>
>
>
> > Please create task then & place link to it here.
>
> > On Thu, May 27, 2010 at 12:47 PM, Phil -- wbtc.fr -- <p...@wbtc.fr> wrote:
>
> >> well, I suggest this feature, another good feature for big projects.
>
> >> Being able to permit to adapt members's page content according to their
> >> membership level, using a tag like :
>
> >> <inp2:m_if check="m_HasUserGroup" group="11">...</inp2:m_if>
>
> >> ps: Alex, I would really like to learn PHP, but... I don't have the magic
> >> formula to extend days ;-) it's planned for later... Actually I learn by
> >> myself how to use and maintain openERP, the best competitor to SAP, and may
> >> we should think about a module for this enterprise class ERP...)
>
> >> 2010/5/26 Phil -- wbtc.fr -- <p...@wbtc.fr>
>
> >>> well, how to check group permission in an other way than using groud ID?
> >>> How to make information displaying or not, depending of the user's group?
>
> >>> 2010/5/26 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>>> Group permission, yes. You could give users from that group specific
> >>>> permission and check it later on front-end.
>
> >>>> On Wed, May 26, 2010 at 6:40 PM, Phil -- wbtc.fr -- <p...@wbtc.fr>wrote:
>
> >>>>> Don't we have a similar system to manage menus displaying upon group
> >>>>> permissions?
>
> >>>>> 2010/5/26 Phil -- wbtc.fr -- <p...@wbtc.fr>
>
> >>>>> oh, ok... well, this would help me a lot!
> >>>>>> It could be usefull also for other projects, don't you think so?
>
> >>>>>> 2010/5/26 Alexander Obuhovich <aik.b...@gmail.com>
>
> >>>>>>> No, I mean we could write one. We don't have one.
>
> >>>>>>> On Wed, May 26, 2010 at 1:04 PM, Phil -- wbtc.fr -- <p...@wbtc.fr>wrote:
>
> >>>>>>>> Thank for you answer Alex, when you say "like", it means I should
> >>>>>>>> adapt it? :$
>
> >>>>>>>> I have Tag *HasUserGroup* Undefined in kmaintagprocessor[Agregated
> >>>>>>>> Tag]:* HasUserGroup*
>
> >>>>>>>> 2010/5/26 Alexander Obuhovich <aik.b...@gmail.com>

Phil -- wbtc.fr --

unread,
May 31, 2010, 5:33:40 AM5/31/10
to in-por...@googlegroups.com
Hi Dmitry,

no problem, thanks for taking care of this request :-)

My example is about link forms. I need to have 3 differents type of subscription (inportal allready handle all needed options, using groups), and for each type of subscription, users would be able to add more or fewer informations in their link record.

Other example, it'd be usefull to display different options in user's account, depending on their member status. For example, toolbox would display more options for some users, as well as a different design, showing their member status (just think bout a "gold" interface for "gold" users).

I've tried to create differents type of forms for link-add and link-modify, but there weren't recognized by inportal (maybe hardcoded for these template's call?), but even if it works, I'd need to choose which link's form to display in user's account.

I hope this make sense.

Phil.

2010/5/31 Dmitry A. <dand...@gmail.com>

Alexander Obuhovich

unread,
May 31, 2010, 6:05:58 AM5/31/10
to in-por...@googlegroups.com
Hiding input fields on forms wouldn't prevent user from submitting those fields by faking POST request to the server, that creates new link. Just note, nothing more.

Phil -- wbtc.fr --

unread,
May 31, 2010, 7:14:42 AM5/31/10
to in-por...@googlegroups.com
thanks for this note, I'm concerned about security too :)

I've also thought about this possibility, but all forms will be reviewed before being online.I've requested a feature to perform a conditionnal check, this way the input fields won't be hidden, but not present at all in the form; users would need to know the fields id and values to fake the post... and it's not an techies website...


2010/5/31 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
May 31, 2010, 7:34:07 AM5/31/10
to in-por...@googlegroups.com
No problem with that. He could pay once to see how fully featured form look like and then emulate one using free listing.

You should not be concerned much about it, since based on listing type only specific fields are shown. This way even if field is filled-in by user (that fake one), then it won't be shown because it doesn't belong to particular listing type.

That of course depends on how you will check that later in detail template.

Phil -- wbtc.fr --

unread,
May 31, 2010, 7:48:18 AM5/31/10
to in-por...@googlegroups.com
alex, this is also a good idea, having different field names for each type of users :)

Your idea on checking in template before displaying on front is good, but I don't know yet how to perform this :s I'd need to check the link owner's group, is there any tag to do this actually?

2010/5/31 Alexander Obuhovich <aik....@gmail.com>

Alexander Obuhovich

unread,
May 31, 2010, 1:21:31 PM5/31/10
to in-por...@googlegroups.com

No. There are no tags to perform group based checks in templates.

On May 31, 2010 2:48 PM, "Phil -- wbtc.fr --" <ph...@wbtc.fr> wrote:

alex, this is also a good idea, having different field names for each type of users :)

Your idea on checking in template before displaying on front is good, but I don't know yet how to perform this :s I'd need to check the link owner's group, is there any tag to do this actually?



2010/5/31 Alexander Obuhovich <aik....@gmail.com>
>
> No problem with that. He could pay once to ...

Phil -- wbtc.fr --

unread,
May 31, 2010, 3:57:13 PM5/31/10
to in-por...@googlegroups.com
ok, it' lead us back to the initial answer... no group checking tag yet.


2010/5/31 Alexander Obuhovich <aik....@gmail.com>
Reply all
Reply to author
Forward
0 new messages