Re: Logic in the init method
Arnaud Limbourg <arnaud-GdXxm9JVFPlWk0Htik3J/[email protected]> Thu, 27 Oct 2005 20:37:30 +0200
| Newsgroups | gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
Lukas Kahwe Smith wrote:
> 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 ..
>
I still find this weird but as long as it is intended and know this is
good :)
Arnaud.