Date: 05/04/01
- Next message: Klaus Seidenfaden: "Sv: [phplib] login before logout"
- Previous message: Paul Wolstenholme: "Re: [phplib] login before logout"
- In reply to: Paul Wolstenholme: "Re: [phplib] login before logout"
- Next in thread: John Mandeville: "Re: [phplib] login before logout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Paul,
thanks for the suggestion, but i don't think that helps me. My
problem is that the lifetime variable for my auth class is set to 15
minutes. It's very easy to not do anything for 15 minutes and then try
to logout. Of course, because fifteen minutes has already passed, when
i click the button to logout, it tries to authenticate me first before
allow me to log out. Tyr setting $lifetime to 1 to see what i am
talking about. It's a kind of chicken and egg problem. The function,
page_open(), needs to come first in the document. i need the auth
variables to know whether i am logged in, but when i try to setup those,
it tries to authenticate me, if i am not logged in. The only thing i
can guess is to try to know the name of the logout page (logout.php in
my case) and test for it within the authentication section. If i can
see that i am on that page, then perhaps i can exit out of the function
and just present a message to the user that they are logged out, even
though it may have happened in the past. i'm going to try that now.
Paul Wolstenholme wrote:
>
> I'm not sure if I'm understanding correctly but this is what I do:
>
> // Uncomment/Comment depending on whether you are using autoprepend or
> not
> require_once("prepend.php");
>
> page_open (array(
> "sess" => "CR_Session4",
> "perm" => "CR_Perm",
> "auth" => "CR_Default_Auth"
> ));
>
> // Canceling login attempt; allow anonymous access again
> if (isset($cancel_login)) {
> $auth->nobody = true;
> unset($Login);
> }
>
> // Logout
> if ($Logout) {
> $auth->unauth($nobody = true);
> unset($Logout);
> }
>
> // Login to CRUX
> if (!empty($Login) && $auth->auth['uid'] == 'nobody') {
> $auth->login_if($Login);
> unset($Login);
> }
>
> // Present either a login or logout option
> if ($auth->auth['uid'] == 'nobody') {
> $$relogin = "Login";
> } else {
> $$relogin = "Logout";
> }
>
> ?>
>
> "darcy w. christ" wrote:
> >
> > hi,
> >
> > does anyone have a good approach to the login before logout problem.
> > What i mean is that i have a logout page, which has a page_open for both
> > session and auth. i need the auth, obviously so that i can destroy the
> > auth object. However, i ocaasionally logout after my auth has been
> > terminated because i've gone past my lifetime. So, when i try to
> > logout, it first asks me to log in. Not very user friendly. Anyway, i
> > suppose i need to do a test to see if i am in fact logged in, before
> > trying to log out. i'm just not sure how to approach this problem. Has
> > anyone resolved this. i appreciate the suggestions.
-- ~darcy w. christ Elegant Communications Inc. 416.362.9772 x222 | 416.362.8324 fax--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>
- Next message: Klaus Seidenfaden: "Sv: [phplib] login before logout"
- Previous message: Paul Wolstenholme: "Re: [phplib] login before logout"
- In reply to: Paul Wolstenholme: "Re: [phplib] login before logout"
- Next in thread: John Mandeville: "Re: [phplib] login before logout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

