Summary: A different way of performing authentication than PmWiki's "default"
Status: deprecated
Categories: Obsolete, Security

Depending on what the user is authenticated as will output the inner text. Examples of usage are below.

This recipe is superceded by later versions of PmWiki -- use the (:if auth read:) and (:if authid:) conditional markups instead. --Pm


This is a out of date as PmWiki now handles authentication differently.

How so? Have recent changes made this recipe invalid? If this script is outdated, is there a way to achieve the same conditional effect? --cboe

The $AuthFunction default method call in pmwiki.php has changed. Authentication in pmwiki.php now only remembers one password, whereas before it maintained a password set (Maybe other changes I haven't looked). This cookbook item will still work, BUT authentication is not the same as out-of-the-box pmwiki.php. -- MarkS

This recipe should still be valid even as of 2.0.beta29 -- it's just a different way of performing authentication than PmWiki's "default". Also, contrary to what MarkS writes - pmwiki still remembers all of the passwords entered by a user (or at least it's supposed to). If not, that's a bug in pmwiki.php . --Pm


(:if authenticated admin :)THE Administrator(:if:)
(:if authenticated read :)Read(:if:)
(:if authenticated edit :)Edit(:if:)
(:if authenticated attr :)Attr(:if:)

Output if the role is "admin": "THE AdministratorReadEditAttr"
Output if the role is "read": "Read"
Output if the role is "edit": "Edit"
Output if the role is "attr": "Attr"

Changes that effect the wiki infrastructure

$Conditions['authenticated'] = 'AuthenticatedAsRole($pagename, $condparm)';
$AuthFunction = 'BasicAuthUsingAuthenticatedAsRoleMethod';


Choose only one of the following files,

Put "AuthenticatedAs_V??.php" into the cookbook/ directory and add the following line to local/config.php


or maybe the following if you have having troubles with your includes.



See discussion at AuthenticatedAsConditional-Talk