AuthenticatedAsConditional

Summary: A different way of performing authentication than PmWiki's "default"
Version:
Prerequisites:
Status: deprecated
Maintainer:
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

Important

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


Usage:

(: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';


Solution

Choose only one of the following files,


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

  include_once("cookbook/AuthenticatedAs_V??.php");

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

  include_once('./../pmwiki/cookbook/AuthenticatedAs_V??.php');

Comments

See discussion at AuthenticatedAsConditional-Talk