[Pmwiki-users] Small Change: Password protection for "action=diff"

Patrick R. Michaud pmichaud
Sun Jun 13 13:47:41 CDT 2004


On Fri, Jun 11, 2004 at 02:55:40PM +0200, Benedikt Hochstrasser wrote:
> suggestion:
> in pagerev.php, replace the line
>     $page = RetrieveAuthPage($pagename,"read");
> with
>     $page = RetrieveAuthPage($pagename,"diff");

As opposed to adding a new password type just for diff (yet another
password to remember!), I will probably change pagerev.php to use 
the variable $DiffPasswordLevel, with the default being "read".  
If someone wants to prevent the public from viewing diffs they can 
change $DiffPasswordLevel to "edit", which means that only those who
have edit privileges can see the page history.

And for those who want a separate "diff" password, they can set
$DiffPasswordLevel='diff'; and supply the passwords accordingly
(cookbook recipe).

BTW, in existing versions of PmWiki one can already password-protect
the diff function using the 'edit' password--add the following to 
config.php (assuming the page doesn't require a different read 
password):

   if ($action=='diff') {
     $page = RetrieveAuthPage($pagename,'edit');
     if (!$page) Abort("?cannot diff $pagename");
   }

Pm



More information about the pmwiki-users mailing list