[Pmwiki-users] Password protection

Patrick R. Michaud pmichaud
Thu May 13 08:45:57 CDT 2004


On Fri, May 07, 2004 at 09:52:51AM -0400, dave at hill-kleerup.org wrote:
> I have a Wiki group that will consist of material that should be visible to
> all comers, and other material that should not be.  [...]
> 
> It would be nice if I could put some sort of indicator in a page that would
> show whether there were [read] or [edit] passwords set for the page.  

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



More information about the pmwiki-users mailing list