[pmwiki-users] Default group with authentication

Tom Lederer pmwiki at celok.de
Thu Mar 1 07:53:41 CST 2007


Hi,

i am not sure if i understood that fully, but from my own experience:

We set up a field, where each user can have his own group. To  
accomplish this we do:
a) user authuser over LDAP (works without LDAP of course too)

b) have in config.php (or similar place):
$group = FmtPageName('$Group', $pagename);
$DefaultPasswords['attr']='id:'.strtolower($group)
$DefaultPasswords['edit']='id:'.strtolower($group)
$DefaultPasswords['upload']='id:'.strtolower($group)

That way only the owner of the group has the rights to modify the group.

(do
$DefaultPasswords['read']='id:'.strtolower($group)
to have the group being readable by the owner only)

c) on a startpage we have:
(:if authid :)
* As you are logged in already, this link points to your personal  
group: [[{$AuthId}/(HomePage)]]
(:if !authid :)
* Your own pages are located here: [=http://sunhome.germany.sun.com/ 
=]''Username''. To be able to use your area, please login: [[{$Name}? 
action=login|Login]]
(:if:)


d) Explanation: in our LDAP directory each user is listed, (with  
lowercase first letter). As the Groups have uppercase first letter,  
we needed it to be converted. Hence the strtolower($group) ((which is  
"string-to-lowercase", you could also use lcfirst (i believe), which  
would be "lowercase-first-letter") )

Works great for us, hope it helps you.

Best Regards,
Tom
-- 
Tom
http://celok.de



Am 01.03.2007 um 09:17 schrieb Jiri Hladůvka / OBUTEX:

> Use AuthUser recipe.
> 1) edit Site/AuthUser and insert the users and groups of users e.g.
> Adams: (:encrypt AdamsPassword:)
>
> 2) create group for each user e.g. Adams/Adams and set the read  
> password
> in Adams/GroupAttributes?action=attr to id:Adams
>
> 3) When Adams log in then the variable {$AuthId} has a value "Adams"
>
> 4) The link [[{$AuthId}/SomePage]] leads to SomePage in the group  
> named
> as logged in user
>
> 4a) use such a link for logedin users ONLY
> (:if  equal {$AuthId} "":) [[{$PageUrl}?action=login|Login please]]
> (:if  !equal {$AuthId} "":)[[{$AuthId}/SomePage]] (:ifend:)
>
> The first line displayes link to log in; after the users logs in the
> same page ( {$PageUrl} )is displayed
> and the link to SomePage] appears.
>
> You can do similar with Profiles/{$AuthId} etc.
>
> Hope this helps,
> regards,
> Jiri
>
>
>
> Keith Edmunds napsal(a):
>> I'm new to pmwiki, so apologies if this is a naive question.
>>
>> I'm considering using pmwiki as a CMS, and have read the recipes  
>> about
>> doing so. One feature I want is for there to be a consistent menu for
>> all authenticated users, but for the actual page linked to for each
>> menu item to be unique per group of users. For example, there  
>> might be
>> a 'my page' link for all authenticated users, but the page displayed
>> will depend on which user is logged in.
>>
>> I think I can do that with groups, and I also think that I can  
>> prevent
>> users in group X seeing the 'my page' page for group Y - is that
>> correct?
>>
>> My real question, however, is can I set up a default group for each
>> user, so that when I display the menu, I can say "this is user Smith,
>> who has a default group is X, therefore the destination for the
>> menu item 'my page' is X/mypage"? Or maybe at authentication I should
>> make the default group (for user Smith) be X - is that  
>> straightforward
>> to do (and sensible)?
>>
>> If the above isn't clear, let me know and I'll try to clarify.
>>
>> Thanks,
>> Keith
>>
>> _______________________________________________
>> pmwiki-users mailing list
>> pmwiki-users at pmichaud.com
>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>>
>> __________ Informace od NOD32 2085 (20070228) __________
>>
>> Tato zprava byla proverena antivirovym systemem NOD32.
>> http://www.nod32.cz
>>
>>
>>
>>
>
> -- 
> OBUTEX s.r.o
> Ing.Jiří Hladůvka
> Zlatovská 22
> 911 01 Trenčín
>
> tel.: +421 (0)32 6587000
> mailto:admin at obutex.com
>
> http://www.obutex.com
>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users




More information about the pmwiki-users mailing list