[pmwiki-users] How to add a read password field to the edit form
pbowers at pobox.com
Mon Aug 11 07:08:56 CDT 2008
You can look at the code in WikiSh.php for wshChmod() to see how to
set a password and potentially append to it. Basically it's a
question of reading & setting a value in $page['passwdread'].
Probably you could hook into the $EditFunctions with another function
that will do what you want it to do.
Hope that gets you started in the right direction.
On Mon, Aug 11, 2008 at 12:40 PM, Lars Grau <mail at larsgrau.de> wrote:
> We have pmwiki-2.2.0-beta65 running with LDAP authentication. We allow
> only authenticated users to edit pages. ( In config.php:
> $DefaultPasswords['edit'] = 'id:*'; )
> Now we'd like to add a checkbox "This is a public page" to the edit
> form that does the following: If unchecked (default), the read
> password for the page being edited should be set to "id:*" allowing
> only authenticated users to VIEW the page. If the author activates the
> checkbox, the read password should be cleared.
> Can anyone point us into a direction how to do this via a cookbook
> recipe or even better - provide the code? We're familiar with PHP in
> general, but we'd like to keep PmWiki as close to the original
> distribution for future updates and therefore need support in
> "hooking" this into the software.
> Tricky sidenote: To be even more precise, if a read password has
> already been set by "?action=attr" (i.e. "secret"), we'd like the
> recipe to append the "id:*" rather than over-writing the entire
> attribute. Same applies for clearing the field. The "id:*" should be
> removed, but everything else should remain untouched.
> Thanks a lot in advance.
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
More information about the pmwiki-users