Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

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

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #101  
Old 05-08-2008, 05:25 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

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

The problem with this mod is anonymous customers - in order to order, they need to enter their e-mail address each time, and the system won't allow them to check out as their e-mail already exists in the system. I really don't recommend this method be used until a way is found to allow anon customers to repeat order.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #102  
Old 05-08-2008, 10:58 PM
 
4worx.com 4worx.com is offline
 

Newbie
  
Join Date: Feb 2008
Posts: 3
 

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

That is no problem in my case. We've set up the shop to only allow checkout for users that are logged in (upon customer request).

Is it still possible then to use the piece of code as described in post #90?
__________________
http://www.4worx.com

X-Cart Gold version: 4.1.9
Reply With Quote
  #103  
Old 05-20-2008, 09:29 AM
  fmoses's Avatar 
fmoses fmoses is offline
Banned
 

Senior Member
  
Join Date: Apr 2008
Posts: 155
 

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

this is the code that i'm finding in my x-cart, can i still replace the code with the above code and still have it work, i tried changing it to that above using dreamweaver, and then i couldn't login at all, kept on saying invalid login. Should i be using something else to edit my files? New to this and fumbling my way around. the only difference is the WHERE BINARY STATEMENT Thanks

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

I had changed it to this
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY (login='$username' or email='$username') AND usertype='$usertype' AND status='Y'");
Reply With Quote
  #104  
Old 05-21-2008, 02:02 AM
 
4worx.com 4worx.com is offline
 

Newbie
  
Join Date: Feb 2008
Posts: 3
 

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

Post #64 works fine!
__________________
http://www.4worx.com

X-Cart Gold version: 4.1.9
Reply With Quote
  #105  
Old 08-01-2008, 10:05 AM
 
JasonMiller1975 JasonMiller1975 is offline
 

Newbie
  
Join Date: Jan 2008
Posts: 2
 

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

I used a combination of posts #64, #67 and #78 to accomplish this. For my test accounts during install, I can still use my username to login with, but for all new customers, or pre-populated customers from an import, email address works for login now.

From a usability standpoint, people are becoming more expectant to use their email address for login purposes, not to mention they are more memorable than a sequentially generated naming convention created by a cart's admin.

Thanks for all your help guys!

Jason Miller
__________________
Version 4.1.8
Reply With Quote
  #106  
Old 08-18-2008, 10:07 AM
 
weckie weckie is offline
 

eXpert
  
Join Date: Feb 2005
Location: Netherlands
Posts: 220
 

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

I have this problem after i used the code from post #64.

"You have specified an incorrect user name. Only numbers (0-9) and lower-case letters (a-z) can be used. Please correct it. "

What to do?
__________________
Herman Steijn

Using: X-cart 4.5.4
AT: http://www.weckonline.com LIVE
Reply With Quote
  #107  
Old 10-17-2008, 08:54 AM
 
skipmartin skipmartin is offline
 

Advanced Member
  
Join Date: Oct 2003
Posts: 30
 

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

To get this to work in 4.1.x in login.php change:
Code:
$user_data = func_query_first("SELECT * FROM $sql_tbl[customers] WHERE BINARY login='$username' AND usertype='$usertype' AND status='Y'");
to
Code:
$user_data = func_query_first("select * from $sql_tbl[customers] where (login='$username' or email='$username') and usertype='$usertype' and status='Y'"); $username = $user_date['username'];

The login script makes additional checks against the username, and it is still set as the email address which will cause those checks to fail until we reset the username to the the actual username.
__________________
Andy Melichar, Tech Director - REBEL INTERACTIVE -
andy@rebel-interactive.com - X-Cart version 4.1.3
Reply With Quote
  #108  
Old 10-18-2008, 08:57 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

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

Quote:
Originally Posted by weckie
I have this problem after i used the code from post #64.

"You have specified an incorrect user name. Only numbers (0-9) and lower-case letters (a-z) can be used. Please correct it. "

What to do?

By default, version 4.1.11 and earlier versions of x-cart that have the the latest security patches do not allow anything other than numbers and lowercase letters to be used.
See the thread at http://forum.x-cart.com/showthread.php?t=41444 for a detailed explanation.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #109  
Old 01-10-2009, 06:30 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

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

Is there any chance this has been updated to work with later versions of X-cart? What we would like to do is eliminate the "username" entirely and have the customer enter an email address and password only.

This would mean a change to register, login, and recover password areas of x-cart. It would also mean that anonymous checkout would have to be disabled.

Anyway, is this something that others would be interested in working on and implementing in 4.1.x and 4.2 versions of X-cart?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #110  
Old 01-10-2009, 07:25 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

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

http://forum.x-cart.com/showpost.php?p=215306&postcount=101

Also, the security patches that came out in the last few months prevent special characters such as @ in the username.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:36 AM.

   

 
X-Cart forums © 2001-2020