![]() |
Wouldn't it be better to update the database with a unique index on e-mail and usertype?
I mean something like Code:
ALTER TABLE xcart_customers ADD UNIQUE (usertype, email); So it would be possible to have a provider, admin and customer account (for testing) on the same e-mail address. What do you think? Hope to hear from you soon. Best wishes, Marc |
the code in 4.1.2 is a little different
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");
Note there's a BINARY there. I followed boomer's instructions, but it seems it doesn't work. Anyone can give some hint? thanks! |
Re: the code in 4.1.2 is a little different
Quote:
4.1.2 It seems a BINARY condition was added to help compare bytes codes vs charachter as is, the mod should still work up to 4.1.1 as-is, however here is the 4.1.2 code for include/login.php: Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY (login='$username' OR email='$username') AND usertype='$usertype' AND status='Y'"); :arrow: http://mysql.com/doc/refman/5.0/en/charset-binary-op.html |
BINARY only makes it case-sensitive even if the charset isn't case-sensitive right? If we are comparing emails, most of the time we can get away without being case-sensitive (though technically emails are case-sensitive but are not generally enforced). This was in the latest v4.0.19 patch but I didn't include it.
|
Re: Use E-mail address instead of username 3.5.x & 4.0
I did this on my 4.1.3 install as descibed by xcell67 on page4 of this thread and it seemed to work OK, but when testing some other things I registered a new user during checkout, this user´s login wasn´t the e-mail address, it was anonymous-4.
Can anyone reproduce this or did I miss something when performing the mod? thanks |
Re: Use E-mail address instead of username 3.5.x & 4.0
Anyone know anything about the above Post? We'd also like to have this since I don't like the idea of people being able to get Account details of 5 people using the same e-mail address.
Cheers. |
Re: Use E-mail address instead of username 3.5.x & 4.0
Hello,
Did anyone get this to works correctly on 4.1.3 yet? I would like to implement it into our site if it will work with our version. Thanks! |
Re: Use E-mail address instead of username 3.5.x & 4.0
I just disabled anonymous orders, everyhing else works fine.
|
Re: Use E-mail address instead of username 3.5.x & 4.0
I've seen alot of elaborate coding to accomplish what seems to be an easy problem to solve. It's entirely possible that I'm missing some things but this is how I force the username = email address issue.
I set the email field to "Unique" and added the following code at the top of include/register.php Quote:
|
Re: Use E-mail address instead of username 3.5.x & 4.0
tpaul,
What version of x-cart are using? Quote:
|
All times are GMT -8. The time now is 11:17 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.