[pmwiki-users] How to detect if a page has @nopass for the read password

Eemeli Aro eemeli at gmail.com
Mon Jul 12 11:45:24 CDT 2010


On 12 July 2010 18:15, Randy Brown <alongkiss at aprivatespot.com> wrote:
> I'm using AuthUser. Version pmwiki-2.2.0-beta65 (and possibly later versions) allowed me to test whether a page was world readable by checking the value of {*$PasswdRead}. In the current version (pmwiki-2.2.17) that ability now seems to be gone for users without attr authorization: they now just see "(protected)" even if they have the right to read the page.
>
> Is there another way to write a conditional to detect whether a page's read password is @nopass?

Slightly hacky, but should work provided that the @nopass is set
directly for the page, and not inherited from the GroupAttributes
page:

Add to a config file:

$FmtPV['$NoReadPasswd'] = "(trim(@\$page['passwdread']) === '@nopass')
? 'true' : 'false'";

and then try the conditional:

(:if {*$NoReadPasswd}:)1(:else:)0(:ifend:)

eemeli



More information about the pmwiki-users mailing list