[pmwiki-users] Fox: replace password in SiteAdmin.AuthUser?

Hans Bracker design at softflow.uk
Thu Feb 9 11:55:48 PST 2023


> I have set up a page with a fox form for a logged in user to change their password like this:

> (:fox change_password_form:)
> (:foxreplace target=SiteAdmin.AuthUser put=regex mark="{(tolower {$Author})}: .*" foxtemplate="{(tolower {$Author})}: {(mycrypt {$$new_password})}":)
> New password:\\
> (:input password name=new_password:)\\
> (:input submit post 'Save new password':)
> (:foxend change_password_form:)

I don't know anything about how PmWiki deals with passwords getting added to the SiteAdmin.AuthUser page.

I would have reservations as to allow Fox to replace anything in the SiteAdmin group. But perhaps that could be okay.

As to your form:
the template string {(mycrypt {$$new_password})} will immediately be turned into a crypted string, on page load. You can check it looking at the page source. You need to use {$$(mycrypt {$$new_password})} 
which makes your Markup Expression into a template variable, and Fox will process that when the form has been submitted, .i.e. first {$$new_password} will be replaced with the text input, and then the markup expression will get evaluated, with the input you want.
As the form is now the new password will never get processed by mycrypt.


~Hans




More information about the pmwiki-users mailing list