[pmwiki-users] UserAuth recipe, $IsUserLoggedIn, and skin.php

Jeremy Sproat sproaticus at gmail.com
Mon Jun 27 00:11:53 CDT 2005


(didn't see the first one go through, here's try two...)

Hello,

I'm using the UserAuth recipe
(http://www.pmwiki.org/wiki/Cookbook/UserAuth) with no real problems.

Except when I try to modify my skin to react to $IsUserLoggedIn.  This
variable always seems to be blank.  I'm not sure what I'm doing wrong,
but I'm sure it's something dumb.  :-)

My skin is in the folder pub/skins/jeremy .  The files jeremy.tmpl and
jeremy.css load just fine.  I'm pretty sure that jeremy.php is loading
too, because my .tmpl can fetch the variable $JeremyButtonBar .

Here's the gist of my jeremy.php code:

<?php if (!defined('PmWiki')) exit();
global $JeremyButtonBar, $IsUserLoggedIn;
if ($IsUserLoggedIn) {
 $JeremyButtonBar = <<< EOT
   <ul id="buttonbar">
     (...much HTML snipped for brevity...)
   </ul>
EOT;
} else {
 $JeremyButtonBar = "<p>Not logged in. (" . $IsUserLoggedIn ." )</p>";
}
?>

I then put the variable $JeremyButtonBar into the .tmpl.  When I load
the page, all I get is the text "Not logged in. ()".  I can use
$LoginName to verify that I AM logged in, but I'd rather my script not
test against this because in theory it could easily change.

Erm... I'm not sure what more information is needed to solve this, but
if you want to help me figure this out, I'll gladly give you all the
information you need.  :-,

Thanks,
 - sproaticus




More information about the pmwiki-users mailing list