|
Cookbook /
AuthenticatedAsConditionalSummary: A different way of performing authentication than PmWiki's "default"
Version:
Prerequisites:
Status:
Maintainer:
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
ImportantThis 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:
Output if the role is "admin": "THE AdministratorReadEditAttr" Changes that effect the wiki infrastructure$Conditions['authenticated'] = 'AuthenticatedAsRole($pagename, $condparm)'; SolutionChoose 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');
CommentsIt even allows 21-Feb-2005 Even when i use such directives it would be nice to have also syntax enahncement
Is this something that one is supposed to place into the editable portion of the wiki page? I am very interested in getting this functionality into the templates themselves (so that one can define out the edit links if no-one is logged in). Also, is this for use with the UserAuth plugin?
03.Mar-2005After update to 2.24/5 the Constellation (:AuthenticatedAsConditional, DropDownSkin with the markup
18-Mar-2005 Would it be possible (or can you tell me how) it could be achieved to add a "Login" button or something similar so an authentication could happen without requiring e.g. editing the page (so the authentication is required before editing is possible?). Would help a lot when e.g. an edit link should be visible only after authentication as e.g. admin. Is calling @[$Authfunction@] sufficient for this task? Which parameters?Klonk You may want to consider the following; (:if ! authenticated edit :) [[Main.HomePage?action=edit | Logon]] (:if:) I haven't quite figured out how to ask for authentication without then moving to the edit page. It would probably mean you have to hack the PmWiki code, which I find tricky at the best of times. No doco, so have to strain the brain I spose. -- MarkS? Edit the page works? What? |