On Tue, Feb 06, 2001 at 12:24:19PM +0100, David Guerizec mentioned:
> > On Mon, Feb 05, 2001 at 10:02:01PM +0100, e-target-b.com  : ARNEODO Jean-Pierre 
>mentioned:
> >> Here is the solution:
> >>     http://www.midgard-project.org/req/midgard-1.4/mgd-get-midgard.htm
> >> In short terms:
> >>     echo $midgard->user;
> >  But won't that only work on a page where you *have* to be logged in on ?
> > Is there a way of saying "if there is a user logged in, get their userid,
> > otherwise just serve a plain page ?"
> if the user is not logged in, $midgard->user will be set to 0 (there is 
> no user with such a userid)

 I'm logged into a page, and at the bottom I have;

 if($midgard->admin) {
     echo "<A HREF=\"/asgard/page/edit/$midgard->page\">Edit this page</A>";
 } else {
     echo "You are not recognised as an admin ($midgard->user) for this page.";
 }

 It always says "You are not recognised", even if /asgard says I am logged
in. If I change the "Authentication:" of a page to "required" instead of
"inherited", the code detects that I'm logged in, and prints "Edit this
page".

Kate

-- 
 When I say 'free', I mean 'free': free from bond, of chain or command: 
to go where you will, even to Mordor, Saruman, if you desire. " 
    -- Gandalf, paraphrasing the choice between Free and Non-free software

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to