Re: liveuser many parallel instances
| From: | Arnaud Limbourg | Date: | Mon, 16 Oct 2006 11:59:02 +0000 |
| Subject: | Re: liveuser many parallel instances | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25468@lists.php.net to get a copy of this message | ||
In this case you can do hand carve you own queries or use Liveuser_Admin
(the first solution should be faster).
'SELECT group_id FROM liveuser_groupusers WHERE perm_user_id=' .
$lu->getProperty('perm_user_id', 'perm');
And then you check if he is in the group you want.
You are probably better off generating constants or an array from the
group_define_name column in liveuser_groups to avoid using ids directly.
Arnaud.
Bernhard Suttner wrote:
> Hi,
>
> yeah this would fix the problem, but I think the solution is not very well, because the rights
> are for all clubs the same and the only difference is the club. I thought, it would be better if I
> create groups for all clubs and create a field for the club_id in the group table. Are there
> anonther, better solutions/or ideas? I wont fix the "silly"-problem but I want a complete
> solution for the Main-problem.
>
> Ideas?
>
> Greets,
> Bernhard Suttner
>
>
> On Mon, 16 Oct 2006 13:23:59 +0200
> Arnaud Limbourg <arnaud@limbourg.com> wrote:
>
>> Hi,
>>
>> In the database dump there are already the tables liveuser_users,
>> liveuser_groups and liveuser_groupusers.
>>
>> You might want to create rights for every club
>>
>> CLUB_BB32_PLAY
>> CLUB_IWJK_PLAY
>>
>> You then assign those rights to the given groups (in your case a group
>> is a club).
>>
>> Since a player is assigned to a club (or several) a check
>> $lu->checkRight(CLUB_IWJK_PLAY) will return false if the user is not a
>> member of the club.
>>
>> Does that answer your question ?
>>
>> Arnaud.
>>
>>
>>
>> Bernhard Suttner wrote:
>>> Helo,
>>>
>>> the environment:
>>> a user belongs to a club and is within a special group. For example:
>>>
>>> User A -> Club BB32 -> Group Player
>>> User B -> Club BB32 -> Group Coach
>>> User C -> Club IWJK -> Group Player
>>> USER D -> Club ER42 -> Group Coach
>>> and so on...
>>>
>>> So I create a table liveuser_user and a table liveuser_group and create
>>> a link between these two tables. The problem is know, how do I avoid
>>> that User C has any right when he want to show the Club BB32 (User C is
>>> Player too, but only when he is in Club IWJK).
>>>
>>> Is that with the liveuser package possible or have I to extend the
>>> liveuser classes?
>>>
>>> Any ideas how to extend liveuser that lu can fullifill this scene?
>>>
>>> Greets,
>>> Bernhard Suttner
>>>
>>
>
>