[pmwiki-devel] Localizing changes from IsAuthorized as well as HandleAttr

Danny Kimsey dekimsey at bellsouth.net
Fri Feb 23 14:13:52 CST 2007


Thank you for the help on your suggestion for the use of the
GL_PERMISSION hash.  That was definetly an easy fix and should have
occured to us sooner :)
Also redirecting the PrintAttrForm function worked well too. Many
thanks on your help on these issues!

--Danny.
On 2/4/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Thu, Feb 01, 2007 at 03:00:04PM -0500, Danny Kimsey wrote:
> > Essentially I've added an additonal check to IsAuthorized.
> > And redirected the PrintAttrForm to my own function.
>
> The redirect of PrintAttrForm is easy to do from a local customization--
> just do:
>
>     $HandleAttrFmt = array(&$PageStartFmt, $&PageAttrFmt,
>       'function:PrintAttrCheckboxForm', &$PageEndFmt);
>
> This overrides the default setting in HandleAttr.
>
> I'm not sure of the details of $GL_PERMISSION and $gl_name,
> but if I'm reading this patch correctly it looks to me as
> though $GL_PERMISSION[$gl_name] simply contains a list of groups
> for which the visitor is a member.  If that's the case, then
> I think the following local customization does what you want
> without any modifications to pmwiki.php:
>
>     # use $GL_PERMISSION and $gl_name to grant access to
>     # specific group names (e.g., '@Supervisor')
>     foreach($GL_PERMISSION[$gl_name] as $group => $v)
>       if ($v) $AuthList["@$group"] = 1;
>
> $AuthList is what PmWiki's built-in authorization uses to
> determine the groups and identities for which the current
> visitor is authenticated.  For example, setting
> $AuthList['@Supervisor'] to a positive value means that
> the current visitor is a member of the @Supervisor group.
>
> So, if we have $GL_PERMISSION[$gl_name]['Supervisor'] as a
> true value, then the above loop would cause PmWiki to
> treat the visitor as being in the '@Supervisor' authorization
> group.
>
> Hope this helps, please let me know if it works.
>
> Pm
>


--
-danny.


-- 
-danny.



More information about the pmwiki-devel mailing list