Friday, June 8, 2007, 10:05:21 AM, Jabba Laci wrote:

> Most of the pages are public, but some of them are made private. These
> private pages have the following line in their source:
> name=<name_of_the_page>
> passwdread=<encrypted_password>                            # here!

> So what I want to catch is: if the page is read protected, i.e. if its
> source contains the line "passwdread=...", then do something (display
> a message for instance).

You may try this custom conditional:

add to config.php:

# custom conditional (:if pwread:)
$Conditions['pwread'] = 'IsPWRead($pagename)';
function IsPWRead($pagename) {
   $page = RetrieveAuthPage($pagename, 'read', false, READPAGE_CURRENT);
   if($page["passwdread"]) return true;
   else return false;
}


Use in wiki page:

(:if pwread:)Page is read protected(:if:)


  ~Hans


_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to