Re: [Phplib-users] Auth working with a twist
Brought to you by:
nhruby,
richardarcher
|
From: Giancarlo <gia...@na...> - 2002-10-13 09:06:02
|
>
> Inside login_if, basically you are unauthed, the session is freezed, and
> the script exits. So if you could place some echoes just after each of
> these necessary calls, and see what the $auth->auth[uid] is like, we could
> have a clue. Or you could try the test defauth.php3 and showoff.php3 pages
> with your 'features' in page_open, and see what happens (if the counters
> increase mainly)..
Or try this in login_if (snapshot)
$this->unauth();
$sess->freeze(); ##### moved here
###### you could even try $this->logout() instead of the two previos
if (! $this->start()) {
# See what form
if ( ($trig == "reg") || ($trig == "log") )
$m=$trig;
else
$m=$this->mode; ## or default
if ($m == "log")
$this->auth_loginform();
else
$this->auth_registerform();
## moved $sess->freeze(); ####moved from here
exit;
There a subtle difference between unauth() and logout(), I think it mimics
yahoo's mail 'logout' or 'exit completely' (dunno relly, I am forced to see
the italian version of yahoo...).
In the first case something is kept from your previous login, eg the name you
typed in the form (uname), some $auth->auth[log_*] info etc.
There is also a kind of bug I found in phplib, that when you are done
logout() your evetual $user object was still there global and set. That can
cause some unadverted programmin erroers, so I modified the logout() to unset
and unregister all eventual $user obj. I still didn't place this in the
lighter unauth() function, but I think it should be there too.
So you can try logout() instead of unauth, in login_if. You'll loose the
uname to place ready in tle 'name' field of the loginform but...
Please, as I cannot reproduce, some feedback.
Gian
|