[pmwiki-users] Getting AuthId in a recipe function

Patrick R. Michaud pmichaud at pobox.com
Wed Aug 30 22:05:32 CDT 2006

On Wed, Aug 30, 2006 at 11:01:26PM -0400, The Editor wrote:
> When I use $AuthId it returns a blank (showing the case was
> triggered).  Is it because the markup is processed before the page
> variables?  (That's the reason I need this shortcut...) Or is there
> some global that needs to be declared?  All I have elsewise is
> $pagename.

Oh, you probably need the global declared, especially if this
is being used in a markup rule.  Try $GLOBALS['AuthId'] .

> If I must use the first option, and assuming most users authenticate
> only one id, how can I retrieve that value?  Using $_SESSION['authid']
> returns the word Array.

You could try $_SESSION['authid'][0], but this is definitely _not_
recommended.  Try the $GLOBALS['AuthId'] solution first.


> On 8/30/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > $_SESSION['authid'] is an array -- it's an array of all of the
> > ids that the visitor has authenticated.
> >
> > But $AuthId ought to work if someone has authenticated -- I'm not sure
> > why it's not working.  Of course, if nobody has authenticated, then
> > $AuthId is blank.
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users

More information about the pmwiki-users mailing list