View Single Post
  #119  
Old 02-15-2009, 05:29 PM
  seaCOAST's Avatar 
seaCOAST seaCOAST is offline
 

X-Adept
  
Join Date: Oct 2002
Location: New Hampshire
Posts: 569
 

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

Quote:
Originally Posted by B00MER
Use E-mail address instead of username for X-Cart 3.5.x & 4.0.

Let users use either their email address or username to login instead of JUST the username.

Edit include/login.php find:

Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE login='$username' AND usertype='$usertype' AND status='Y'");

Change to:

Code:
$user_data=func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'");

Should work without troubles on 3.5.x and 4.0.x

I know this is an old post, but how can I make this work in 4.2.x?

The line I found in my login.php looks like this:


Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY LOWER(login)='$username' AND usertype='$usertype' AND status='Y'");


Thanks!
__________________
Xcart V4.5.5 Gold
seaCOAST
"Live FREE or DIE!"
Reply With Quote