[pmwiki-users] Making new pages only editable by creator with AuthUser

Patrick R. Michaud pmichaud at pobox.com
Wed Sep 13 11:11:55 CDT 2006


On Wed, Sep 13, 2006 at 11:20:43AM -0400, Pierre Racine wrote:
> > For the second part (limiting editing of a page to its creator),
> > we need a special function in the editing sequence to set the
> > initial password of a page.  Fortunately this isn't too
> > difficult -- put the following in config.php:
> > 
> >     function OnlyCreatorEdit($pagename, &$page, &$new) {
> >       global $AuthId;
> >       if (!PageExists($pagename))
> >         $new['passwdedit'] = "id:$AuthId";
> >     }
> > 
> >     array_unshift($EditFunctions, 'OnlyCreatorEdit');
> > 
> 
> Great! Thanks a lot Pm. You're doing a wonderful work.
> 
> I added: 
>         $new['passwdattr'] = "id:$AuthId";
> 
> So password attributes are also set to the creator...

That works, although it might not be necessary or desirable, 
as the attr password automatically defaults to the edit password
if no other attr password is set.

Pm




More information about the pmwiki-users mailing list