Re: Logic in the init method
Lukas Kahwe Smith <[email protected]> Thu, 27 Oct 2005 17:07:39 +0200
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
Arnaud Limbourg wrote:
> I found an odd behaviour in the login/logout handling logic in the init method.
> The following code gets executed after the logout has been called. To me this
> is not very logical that you could logout to relogin immediatly with the same
> call, shouldn't the condition be changed to !$this->isLoggedIn() && !$logout ?
>
> Does anybody have any thought on this ?
>
> Relevant code:
>
> 940 if (!$this->isLoggedIn()) {
> 941 if (!$this->login($handle, $passwd, $remember) &&
> $this->getErrors()) {
> 942 return false;
> 943 }
> 944 }
No, I find it very logical :-)
As a matter of fact very login attempt for a loggin user implies a
logout. This makes it possible for people to clean up things etc. If we
implicitly do this anyways, we should also support it explicitly imho ..
regards,
Lukas