X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Use E-mail address instead of username 3.5.x & 4.0 (https://forum.x-cart.com/showthread.php?t=8809)

marcgeldon 07-14-2006 06:54 AM

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

qinwubi 08-09-2006 02:53 PM

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!

B00MER 08-10-2006 08:53 PM

Re: the code in 4.1.2 is a little different
 
Quote:

Originally Posted by qinwubi
$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!


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

nevets1219 08-11-2006 07:43 AM

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.

showoff 11-27-2006 02:23 AM

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

just wondering 12-01-2006 02:36 AM

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.

stevekem 12-11-2006 10:02 AM

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!

showoff 12-12-2006 02:07 AM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
I just disabled anonymous orders, everyhing else works fine.

tpaul 12-28-2006 02:40 PM

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:

$email = strtolower($email);
$uname = $email;


stevekem 12-28-2006 02:47 PM

Re: Use E-mail address instead of username 3.5.x & 4.0
 
tpaul,

What version of x-cart are using?



Quote:

Originally Posted by tpaul
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



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.