<HTML dir=ltr><HEAD><TITLE>Re: [pmwiki-users] easy question to all</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText487 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>That worked like a charm!</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2>Chris</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Patrick R. Michaud [mailto:pmichaud@pobox.com]<BR><B>Sent:</B> Wed 10/15/2008 3:41 PM<BR><B>To:</B> Swift, Chris<BR><B>Cc:</B> PmWiki Users<BR><B>Subject:</B> Re: [pmwiki-users] easy question to all<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>On Wed, Oct 15, 2008 at 09:33:38AM +0200, Swift, Chris wrote:<BR>&gt; Ok, for some reason I still can't edit freely in pages that are already<BR>&gt; created.&nbsp; I still need the group password to edit anything.&nbsp; Could that be<BR>&gt; because $DefaultPasswords['edit'] ?&nbsp;&nbsp; Maybe should I set this per group?<BR>&gt; $DefaultPasswords['Main'] = crypt('group_creation_password'); for example?<BR><BR>Note that the code I gave depends on the existence of a page called<BR>"HomePage" in whatever group the page being edited belongs to.&nbsp; So,<BR>if you try to edit Group.ABC and Group.HomePage doesn't exist, then it'll<BR>look for the group password.<BR><BR>Perhaps a better approach would be:<BR><BR>&nbsp;&nbsp;&nbsp; $pagename = ResolvePageName($pagename);<BR>&nbsp;&nbsp;&nbsp; $rc = FmtPageName('$Group.HomePage', $pagename);<BR>&nbsp;&nbsp;&nbsp; if (!PageExists($pagename) &amp;&amp; !PageExists($rc))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DefaultPasswords['edit'] = crypt('group_creation_password');<BR><BR>This requires the group creation password if the page being edited<BR>doesn't exist *and* there's not a HomePage for the group.<BR><BR>Pm<BR><BR><BR><BR>&gt; On Tue, Oct 14, 2008 at 05:23:42PM +0200, Swift, Chris wrote:<BR>&gt; &gt; Also, I would prefer to create a password in order to create new<BR>&gt; &gt; groups, instead of leaving it only to admin.&nbsp; That way I could<BR>&gt; &gt; still empower "moderators" but not give everyone access to create<BR>&gt; &gt; new groups.&nbsp; Any ideas would be appreciated...<BR>&gt;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $pagename = ResolvePageName($pagename);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; $rc = FmtPageName('$Group.HomePage', $pagename);<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp; if (!PageExists($rc))<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DefaultPasswords['edit'] = crypt('group_creation_password');<BR>&gt;<BR>&gt; Pm<BR>&gt;<BR></FONT></P></DIV></BODY></HTML>