[pmwiki-users] How to add a read password field to the edit form
vadmin at math.uconn.edu
Mon Aug 11 09:55:15 CDT 2008
Somewhat related, Hans helped me create a recipe that would add an
edit password basically of
id:$AuthUser when creating a profile page.
The key is a small php program that adds the password before saving.
PHP isn't really so hard if you have enough examples close to what
you want to do.
On Aug 11, 2008, at 9:11 AM, Lars Grau wrote:
> Peter, thanks for your quick anwer!
> I see the $EditFunctions array is a good place to hook in. I assume
> you are suggesting to write an own recipe for this, right? I am aware
> of the $page['passwdread'] variable and I have checked the file you
> suggested, but I am definitely not able to strip out the code pieces I
> need from that file or to code an own recipe.
> I have had a look at the cookbook recipe called "EditTitle" before
> ( http://pmwiki.org/wiki/Cookbook/EditTitle
> ) to take that as a basis but I figured out that I am not capable of
> doing this...
> This would be my first recipe, but I need way more code ... or someone
> to do it for me .-)
> L.- (Rookie)
> On 11.08.2008, at 14:08, Peter Bowers wrote:
>> 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
>>> 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
>>> 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
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
More information about the pmwiki-users