[dokuwiki] passing username of logged in user to another php script

  • From: Paul Metzger <pmetzger@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 10 May 2006 12:14:03 -0600

Folks,

We're using Doku to handle documentation serve as the company Intranet. Doku is sweet!

Anyway, I've run into a problem after moving the wiki from Apache on OS X to IIS on Windows. We have a small custom php/mysql app (stuck inside an iframe in a doku page via the html tags) that I need to pass the username of the current logged in user to.

On the OS X / Apache system this was a simple matter of my script getting it out of the session:
$_SESSION['PioneerWiki']['auth']['user']


However, when I moved to the IIS machine, this broke. I do a print_r on $_SESSION and it's empty.



Instead of my script directly grabbing the info, I was thinking that doku could pass it off to my script.

I've tried var plugin (http://wiki.splitbrain.org/plugin:var) and i can get the username to display in page fine with @USER@, but it doesn't work inside of links, html, or php snippets, so that's no good for passing off to my script.

The closest thing i've found is to go into php mode and do
global $USERINFO;

which gets me the doku USERINFO global, which stores some user info.
here's the print_r:

Array ( [pass] => d6e276fc5d9ad90e6120529ae39eb2bf [name] => Paul Metzger [mail] => pmetzger@xxxxxxxxxxxxxx [grps] => Array ( [0] => admin [1] => it [2] => pioneer ) )


that way I can get the email address (good as username, for my purposes) with something like
$email=$USERINFO['mail'];


and then pass it off to my script in the querystring, ie

echo("<iframe src=\"/myscript.php?wikiuser=$email\" width=\"100%\" height=\"1000px\">
Your browser must support iframe for this to work
</iframe>
");


of course, that means that anyone can hit myscript.php independently of the wiki
/myscript.php?wikuser=whoeveriwant
which is not secure at all


Since it's on the corporate Intranet, the security issue isn't THAT big of a deal, but I'd still like to do this the RIGHT way.

Stupid Microsoft. The session method worked so well on the Mac.

Thanks in advance for any advice you can offer.

Cheers,
Paul
---
Paul Metzger
Assistant Director of Information Technology Services
Pioneer Newspapers
Idaho State Journal
pmetzger@xxxxxxxxxxxxxx
(208) 232-4161 ext 334



--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts:

  • » [dokuwiki] passing username of logged in user to another php script