[pmwiki-users] easy question to all
Patrick R. Michaud
pmichaud at pobox.com
Wed Oct 15 08:41:06 CDT 2008
On Wed, Oct 15, 2008 at 09:33:38AM +0200, Swift, Chris wrote:
> Ok, for some reason I still can't edit freely in pages that are already
> created. I still need the group password to edit anything. Could that be
> because $DefaultPasswords['edit'] ? Maybe should I set this per group?
> $DefaultPasswords['Main'] = crypt('group_creation_password'); for example?
Note that the code I gave depends on the existence of a page called
"HomePage" in whatever group the page being edited belongs to. So,
if you try to edit Group.ABC and Group.HomePage doesn't exist, then it'll
look for the group password.
Perhaps a better approach would be:
$pagename = ResolvePageName($pagename);
$rc = FmtPageName('$Group.HomePage', $pagename);
if (!PageExists($pagename) && !PageExists($rc))
$DefaultPasswords['edit'] = crypt('group_creation_password');
This requires the group creation password if the page being edited
doesn't exist *and* there's not a HomePage for the group.
> On Tue, Oct 14, 2008 at 05:23:42PM +0200, Swift, Chris wrote:
> > Also, I would prefer to create a password in order to create new
> > groups, instead of leaving it only to admin. That way I could
> > still empower "moderators" but not give everyone access to create
> > new groups. Any ideas would be appreciated...
> $pagename = ResolvePageName($pagename);
> $rc = FmtPageName('$Group.HomePage', $pagename);
> if (!PageExists($rc))
> $DefaultPasswords['edit'] = crypt('group_creation_password');
More information about the pmwiki-users