Drupal login with existing ZenCart email address, fails with single sign on enabled
| Project: | Zen Cart Integration |
| Version: | 5.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
This module is really great, considering it is BETA I am amazed at how well it works. I did however run into one problem.
I want to use this as a way for my existing zencart customers to view their previous orders. So my hope is to have customers sign in to Drupal with their existing email address and password from zencart, then when they hit the my account page I will have some html that tells them to go to /my account page in the integrated zencart install for their 'archived orders'. This works great in testing when I log in once, then I cannot log back in. I think it has to do with the username that gets generated into drupal:
Here is what is happening:
1. Login to drupal with existing zencart user email of testuser@test.com.
2. If single sign on is enabled the user name generated within drupal for this user is TestUser, not testuser@test.com.
3. If single sign on is not enabled the user name generated within drupal for this user is testuser@test.com.
4. When single sign on is enabled then for some reason the password is not stored correctly in the drupal db.
5. When signle sign on is not enabled the password is store correctly in the drupal db and I can log in and out as the zencart customer (now with a drupal account).
If I can get this to work my problem is solved, I can move away from zencart and just use this module as a bridge so my customers can seamlessly view older orders but place new orders strictly in drupal (I am using UberCart).
My install is Drupal 5.10 and Zen 1.3.7 along with UberCart.
Any help would be greatly appreciated.

#1
I think I got this to work by commenting out these two lines: (around line 475 in zencart_users.module)
// generate a username so that users are not listed publicly by their email address
// $username = _zencart_users_get_username( $customer->customers_firstname, $customer->customers_lastname, $user_edit->init );
// db_query("UPDATE {users} SET mail = '%s', name = '%s' WHERE uid = %d", $user_edit->init, $username, $user_edit->uid);
I have the LoginTobaggan module installed which allows for a email@domain.com user name so I think this will be OK to have these lines commented out. Anyway when I comment them the user name is set to testuser@test.com in Drupal and now the pwd appears to be stored properly in Drupal because I can log in and out as the customer successfully now and the SSO feature will allow me to point my customers to their order history without having to import all of that into my new drupal/ubercart version of my store!
Thank you for making this module! I really look forward to this going gold!
#2
Unfortunately when I comment out those lines, although I can log in and out but the customers email address is not stored as the email address in the customer record, only the username. I suspect that would cause a problem when the customer tries to checkout or drupal needs to email the customer.
#3
Hi Chris, Have you had any luck with this, I'm looking into a Drupal and Zen Cart linkup site but need to know that it's viable.
#4
Hi Chris, Have you had any luck with this, I'm looking into a Drupal and Zen Cart linkup site but need to know that it's viable.