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
  #51  
Old 07-14-2006, 06:54 AM
 
marcgeldon marcgeldon is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 65
 

Default

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
__________________
Marc Geldon (PRO IT SYSTEMS)
http://www.proitsystems.de

X-Cart PRO 4.1.3
Reply With Quote
  #52  
Old 08-09-2006, 02:53 PM
 
qinwubi qinwubi is offline
 

Member
  
Join Date: Jul 2006
Posts: 16
 

Default 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!
__________________
all the best,
Wubi
:::::::::
xcart gold v4.3.2 with lots of customizations
Linux
Php 5.2.4
MySQL: 4.1.22-standard
Reply With Quote
  #53  
Old 08-10-2006, 08:53 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default 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'");

http://mysql.com/doc/refman/5.0/en/charset-binary-op.html
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #54  
Old 08-11-2006, 07:43 AM
 
nevets1219 nevets1219 is offline
 

eXpert
  
Join Date: Jun 2006
Posts: 351
 

Default

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.
__________________
4.1.8
Reply With Quote
  #55  
Old 11-27-2006, 02:23 AM
 
showoff showoff is offline
 

Member
  
Join Date: Apr 2004
Posts: 27
 

Default 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
__________________
Showoff Imports.nl - Largest Tuning Store of Europe
-----------------------------------
Currently using X-Cart 4.1.3
Reply With Quote
  #56  
Old 12-01-2006, 02:36 AM
 
just wondering just wondering is offline
 

X-Adept
  
Join Date: Oct 2006
Location: UK
Posts: 471
 

Default 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.
__________________
Location: UK
X-Cart: Gold 4.4.2, Status: Finalizing
Template: Colors
Free Mods: Colour Coded Orders, FAQ Manager
Paid Mods: None... yet.
Server: Linux, Apache: 2.2.15 (Unix), MySQL: 5.0.90-community, PHP: 5.2.13
Reply With Quote
  #57  
Old 12-11-2006, 10:02 AM
 
stevekem stevekem is offline
 

Senior Member
  
Join Date: Dec 2006
Posts: 111
 

Default 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!
__________________
X-Cart Gold v4.4.1
Reply With Quote
  #58  
Old 12-12-2006, 02:07 AM
 
showoff showoff is offline
 

Member
  
Join Date: Apr 2004
Posts: 27
 

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

I just disabled anonymous orders, everyhing else works fine.
__________________
Showoff Imports.nl - Largest Tuning Store of Europe
-----------------------------------
Currently using X-Cart 4.1.3
Reply With Quote
  #59  
Old 12-28-2006, 02:40 PM
  tpaul's Avatar 
tpaul tpaul is offline
 

Newbie
  
Join Date: Dec 2006
Posts: 3
 

Default 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;
__________________
~Tyson
Reply With Quote
  #60  
Old 12-28-2006, 02:47 PM
 
stevekem stevekem is offline
 

Senior Member
  
Join Date: Dec 2006
Posts: 111
 

Default 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
__________________
X-Cart Gold v4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 07:02 PM.

   

 
X-Cart forums © 2001-2020