[Pmwiki-users] Password protection

*** Dave Hill dave
Fri May 14 12:01:23 CDT 2004


> I think it should be possible to come up with a cookbook recipe for this.
> Essentially one creates a variable that is set when the page has a read/edit
> password, then uses that variable in the template.  For example, in
config.php:
>
>    $page = ReadPage($pagename);
>    if (isset($page['passwdread'])) $PageHasReadPassword = 'readpw set';
>    if (isset($page['passwdedit'])) $PageHasEditPassword = 'editpw set';
>
> then you can use the variables $PageHasReadPassword and $PageHasEditPassword
in
> a template to display "readpw set" or "editpw set" on any page that has one
of
> those passwords set.  Of course, you can change the text that is displayed
to
> whatever you'd like, including html tags.
>
> Pm

I'm clearly doing something wrong here, since I cut-n-pasted the above into my
config.php, then put the variables into my template, only to have the
variables show up like any text (i.e., the "$PageHasReadPassword" text shows
up, not the value).

If I'm betraying my PHP ignorance here and doing something utterly goofy,
please forgive me.

*** Dave




More information about the pmwiki-users mailing list