[ic] CookieLogin with indirect_login
Kevin Walsh
kevin at cursor.biz
Tue Mar 6 16:47:06 EST 2007
Bill Carr <bill at bottlenose-wine.com> wrote:
> I'm having trouble getting automatic logins to work with CookieLogin.
> I am using Interchange 5.4.1 (UserDB.pm,v 2.41 2005/11/08) with
> indirect_login. I am able to login with the correct value in my
> indirect_login field (email). However, the MV_USERNAME cookie is set
> to the value of the username field. When I come back to the site the
> cookie login is attempted but since indirect_login is set for my
> userdb the following indirect_login query is attempted:
>
> select username from userdb where email = '61'
>
> I login like so:
> [userdb function=login indirect_login=email cgi=1]
> I'm logged in but MV_USERNAME cookie is the username field from userdb.
>
> When I come back indirect login is attempted with the value of my
> username from the MV_USERNAME cookie not my e-mail address.
>
>
> Is anyone using inderct_login with CookieLogin and is it working?
>
Not me, but I just spent a couple of minutes looking at the code.
The following patch is completely untested, but it may be worth a go:
--- UserDB.pm 15 Jan 2007 18:45:45 -0000 2.51
+++ UserDB.pm 6 Mar 2007 21:43:34 -0000
@@ -1323,7 +1323,7 @@
);
}
- username_cookies($self->{USERNAME}, $pw)
+ username_cookies($self->{PASSED_USERNAME} || $self->{USERNAME}, $pw)
if $Vend::Cfg->{CookieLogin};
if ($self->{LOCATION}{LAST} ne 'none') {
You will need to clean out your MV_USERNAME cookie after patching.
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin at cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/
More information about the interchange-users
mailing list