[pmwiki-users] How to detect if a page has @nopass for the read	password
    Randy Brown 
    alongkiss at aprivatespot.com
       
    Mon Jul 12 21:11:25 CDT 2010
    
    
  
Thanks for the suggestion, Eemeli.  Unfortunately, that just gave me a blank page. 
BTW, for those of you trying this at home, the solution I came up with earlier doesn't handle the default being set by the site. To allow for a Site default password requires an even more clumsy solution. 
In a config file put:
$PageReadPswd = "(trim(@\$page['passwdread']))";
$FmtPV['$PageReadPswd'] = $PageReadPswd;
$FmtPV['$SiteReadPswd'] = $DefaultPasswords['read'];
In markup on a page put:
(:if ( equal "{*$PageReadPswd}" "@nopass" ) or ( ( equal "{*$PageReadPswd}" "" ) and ( equal "{{*$Group}.GroupAttributes$PageReadPswd}" "@nopass" ) ) or ( ( equal "{*$PageReadPswd}" "" ) and ( equal "{{*$Group}.GroupAttributes$PageReadPswd}" "" ) and ( equal "{$SiteReadPswd}" "nopass" ) ) :)
Randy
On Jul 12, 2010, at 6:45 PM, Eemeli Aro wrote:
> Here's a still hacky but possibly more robust & inheriting approach --
> assuming that it works, as I haven't tested it:
> 
> $FmtPV['$NoReadPasswd'] = "($GLOBALS['NoHTMLCache'] & 2) ? 'false' : 'true'";
> 
    
    
More information about the pmwiki-users
mailing list