When using uc_signup to gather profile fields for an applicable product, the drupal generated passwords for anonymous checkout are only one character. I've disabled all other modules and narrowed it down to uc_signup. It happens on both PayPal Standard and uc_free_order. Disabling uc_signup returns password generation to normal. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | usersave.patch | 3.52 KB | brentratliff |
| #16 | passwordfix.patch | 1.34 KB | brentratliff |
Comments
Comment #1
ezra-g commentedStrange -- I'm hoping to give this module some love on Tuesday and will followup here.
Comment #2
brentratliff commentedezra-g, thanks for the quick response. Also to note and probably related, users aren't getting automatically logged in on the return from PayPal after payment with uc_signup enabled but they are with it not enabled. Could this be related to the patch http://drupal.org/node/700270 that went in to uc_paypal in conjunction with uc_signup? I also notice that with uc_signup enabled with this patch (or UC 2.3) the account gets created during the review phase and there is a system message from the user module that states account information has been emailed to the new user. I believe this is causing a conflict with uc_eco which allows users to create their own username and password on the checkout pane. Even though this is before the review step, it's not getting captured and Ubercart is deriving the username from the email address and generating a one character password with or without uc_eco enabled.
The sold roles are coming back appropriately from PayPal after payment and the profile information and signup infomation are attaching properly, it just seems like something is getting lost or misinterpreted on the return. Let me know if you want to try to register on the dev site to check the behavior. Thanks again.
Comment #3
brentratliff commentedTo clarify, it looks like single character passwords and not automatically logging in users happens regardless of payment method. I've been testing it with uc_free_order. The only PayPal specific problems I'm having are with a conflict with uc_eco for choosing own username and password due to the above patch. The single character password/logging in doesn't seem to be related to the patch.
Comment #4
ezra-g commentedHow are you seeing that the passwords are being generated with a single character in length? Since the passwords are MD5 hashed in the database, you can't read them directly.
UC_Eco looks like it's got a lot of different miscellaneous tweaks that could be hard to track. Regarding user creation order, it looks like uc_eco works by populating the default part of the Ubercart order that UC core uses to create new accounts, which in my experience *is* compatible with uc_signup. You might try making the weight of uc_eco higher than uc_signup, so that it creates the new user account before uc_signup_order() is invoked. That way, uc_signup will see that the user exists and simply assign the signup to the existing account.
Comment #5
ezra-g commentedAlso, do you have "Login users when new customer accounts are created at checkout." checked at http://localhost/dev/contrib/cod/admin/store/settings/checkout/edit/basic ?
Comment #6
ezra-g commentedYou're right that if uc_signup creates accounts when hook_order case 'submit' is invoked, then the combination of Paypal WPS, uc_eco, and uc_signup *and* signing up the same user who is using the uc_econ account form won't work *if* uc_eco places it's new user form before the order is previewed. If taht is the case, my suggestion is to not use that part of the module if you must use PayPal with the above configuration.
Comment #7
brentratliff commentedThanks ezra-g. I don't need to use eco but I will try adjusting the weight in the system table. I took a look in the database and the passwords are MD5 hashed and look normal but they're not. We noticed it in testing when all users received their system generated email with username and password. Usernames are created from the email address by Ubercart but the passwords they are getting sent via email are only one character. I can then login as these users with the one character password, so it's a legit password. Users are also not getting automatically logged in upon return from any payment method. The settings are correct in Ubercart and if I disable uc_signup, everything works as intended. I'm going to reinstall beta 4 with devel, see if I see it and then run the updates on the beta 5 codebase to see if I can clear it somehow or figure out when it was introduced. I'll let you know. Thanks again.
Comment #8
ezra-g commentedAt this point, definitely don't run beta5 -- run the dev instead.
Comment #9
brentratliff commentedOk, I updated the codebase to dev and used the devel module to reinstall uc_signup. I checked the database and all tables were properly emptied on reinstall. I disabled all non-core ubercart add ons. I am still getting 1 char passwords and no automatic logging in. In addition, the checkout completion page shown to these users is the page for logged in users even though they are not logged in and they receive the generic new account email from Drupal. When everything is working without uc_signup, they get the correct page for newly created users/customers with proper passwords and get the proper email from Ubercart. I'm wondering if this is due to the change in locking signups? Thanks again.
Comment #10
brentratliff commentedOn further review it looks like that when uc_signup is enabled, the user accounts are being created by 'admin' somehow but with uc_signup disabled, Ubercart is creating the accounts. I think this is the source of the problem and explains the different emails and checkout completion pages. Thanks again.
Comment #11
echoz commentedI'm also getting passwords of one character, as seen in the customer email, + like the original poster, this is the email from Drupal ("administrator created an account for you.."). I got the same result with and without "Login users when new customer accounts are created at checkout" and incidentally, with it checked, they still were not logged in.
I am not using uc_eco. I am using uc_free_order, although my tests are not using that, I am testing with test gateway. Using dev version from Aug 1, no other patches applied, Ubercart 6.x-2.3, Drupal 6.17.
Comment #12
echoz commentedThis has been resolved for me when reinstalling uc_signup latest dev fresh on a copy of the site that never had any older versions.
Comment #13
echoz commentedI spoke too soon. When my signups weren't being created (uc_signup's weight not -1 issue), like the above poster described, I was seeing Ubercart's email, which does have a good password. After I fixed the db weight and have signups being created, I'm getting what looks like a drupal site registration email, with the one character password.
I get these using test gateway. Also testing with PayPal WPPro + PayPal Express, but the PayPal sandbox doesn't include emails that aren't PayPal specific.
Comment #14
brentratliff commented++ with uc_free_order. It seems as though it affects every payment method when the module is installed.
Comment #15
brentratliff commentedI'm tracking this one down. I hope to have a patch soon.
Comment #16
brentratliff commentedI tracked it down to drupal_execute in xdebug. user_password() was returning a proper password but since Drupal requires password verification when a user account is created, the password was being truncated to one character in drupal_validate_form. The password has to be passed in twice to validate. Attached patch fixes the issue.
Comment #17
ezra-g commentedMarking as needs review. Thanks for the thorough investigative work here!
Comment #18
echoz commentedWorking with test gateway, thank you brentratliff!
It seems that even if the ubercart checkout setting to send account details is checked, it is not used in place of the required Drupal new user setting, which seems fine, although your Drupal message might need to be written for a wider use than ubercart's, if we could use it.
Comment #19
echoz commentedI meant to add.. the patch applied with "Hunk #1 succeeded at 656 with fuzz 2 (offset 6 lines)."
Comment #20
brentratliff commentedThe user is created by admin in the module to get around CAPTCHA/Mollom etc. That's why the 'admin created an account for you' actions get triggered. I rewrote my admin created account messages for now, but am looking for a way to create the user without masquerading as user 1 while still getting around CAPTCHA. user_save may be an option instead of drupal_execute. I'm glad to hear the patch worked for you.
Comment #21
brentratliff commentedezra-g,
While this patch does fix the password issue for drupal_execute(), I'm working on another method that creates the user without masquerading as user 1 and respects the Ubercart settings for automatically logging in users. I should get it finished shortly.
Comment #22
echoz commentedMaybe related to the difference where this is generated from, is in the thank you section of the uc_order-customer.tpl it includes username + password if new user, but that is left out of the invoice emails my testing is getting.
Comment #23
brentratliff commentedHere's a new patch that creates the user with user_save() instead of drupal_execute(). This both prevents the one character password as well as the issues that come with users created by 'admin' that have caused numerous bug reports. Successful checkout of a signup enabled node will trigger the authenticated user order actions and send the email through Ubercart instead of Drupal core's 'created by admin' email. This way, the settings in the store will be respected. Captcha is not an issue with user_save() either. Much of the code was borrowed from uc_cart in UC core. The newly created Attendee 1 will get the checkout completion screen if checkout is anonymous. Coming soon, a patch that will allow the auto logging in on completion of Attendee 1 if it's set in the store settings.
Comment #24
brentratliff commentedMy previous patch, passwordfix.patch, should be reversed before applying this patch.
Comment #25
echoz commentedpatch from #23 (on otherwise unpatched dev) working, Nice work! Sends email from ubercart store setting address, and still fixes one character password issue.
A new issue is these signups are not entered as "count_towards_limit" in signup_log table to be counted as "Signup slots used".
I have an existing issue that previously only my PayPal signups did this #902482: Successful PayPal orders not counted as Signup slots used but my test gateway signups did count towards slots used, now after this patch, the test gateway signups also are not counted as "Signup slots used".
@brentratliff are you seeing this too?
My other point about the uc_order-customer.tpl - the conditional is
if (isset($_SESSION['new_user']))
then it includes username + new password - I'm not sure why or how to get this to show. This is minor, but the "count_towards_limit" in signup_log table is very important for this site's workflow.
Comment #26
brentratliff commentedechoz,
I wasn't seeing that because I didn't have a limit set. I'll have to take a look at that. It may offer another clue now that we know this patch and PayPal are causing this. As far as including the username and password in the emails, I used these values in the existing user and new user email templates in checkout message settings:
Comment #27
echoz commented@brentratliff I'm grateful you're working on this.
the new username + new password I am referring to is not from the checkout message settings, it's the invoice, uc_order-customer.tpl, using variables rather than tokens - by default it uses $new_username + $new_password but the conditional if (isset($_SESSION['new_user'])) is not being met.
Comment #28
brentratliff commentedechoz,
$_SESSION['new_user'] should be set. I need to take a look. Also, are your orders getting attached to a username with the patch?
Comment #29
echoz commentedYes, orders are attached to username, and all is right with order, user account and signup being connected (except the "count_towards_limit" in signup_log table). Getting this in the invoice is not a high priority unless it's a clue towards something else. My priority need is "count_towards_limit".
Comment #30
brentratliff commentedezra-g,
I would love to get your thoughts on this patch. I't's working for my use case, but it looks like it may be causing other issues. I'll try to find time to debug the CA issues later this week, but it may take me a while to get to it and I don't want to troubleshoot in the wrong direction.
Comment #31
echoz commentedApologies, my error!
#23 usersave.patch is working for me and not causing any issues, it was me missing a configuration setting installing signup_status amidst testing. "count_towards_limit" is working!
My secondary issue of new username + new password not outputting to the invoice is still not working but not related, as it doesn't work in all conditions.
Comment #32
brentratliff commentedCool, I wasn't able to reproduce those errors so thanks for reporting back. I'm not seeing any other issues from the usersave.patch.
Comment #33
echoz commentedusersave.patch from #23 still applies cleanly to the new dev version from Sep 15 - I still get the one character password without the patch.
I suspect others get this, but it's not reported since it doesn't break anything - the one character password works. I hadn't found other issues this also addresses that you referred to in #23.
Comment #34
bewhy commentedI've tested the patch on #23 and it seems to be working for me. I am using FreeOrder as my payment method and Loggintoboggan also.
When signing up a new user and not putting in a username or password, the user receives an email with a 'confirmation' link.
More feedback:
It would be nice if the order completion page said something about sending the email. Currently it displays (extra breaks removed):
"Your order is complete! Your order number is 47.
Thank you for shopping at [site name]. Your current order has been attached to the account we found matching your e-mail address.
Login to view your current order status and order history. Remember to login when you make your next purchase for a faster checkout experience!
Return to the front page."
I'd suggest something like:
"Thank you for shopping at [site name].
Your order is complete! An email has been sent to the email address provided, confirming your order. Your order number is 47.
[if new user] [bold] An account has been created for you and an email has been sent with a confirmation link, use that to log in, review your order and browse the site further. [bold]
[If not new user] Login to view your current order status and your order history.
Remember to login when you make your next purchase for a [bold]faster[bold] checkout experience!
Return to the front page to browse the site further."
Comment #35
brentratliff commented@BeWhy,
You can change the order completion messages at admin/store/settings/checkout/edit/messages. With the usersave.patch, the existing users text controls the message. Without the patch, the admin created users text controls the message. For the uc_signup module to work, the accounts have to be created in either the module or by UC. uc_signup creates the users before checkout and assigns them to the event after successful checkout through the CA's. I don't really see anyway around creating the accounts before checkout completion if we maintain the ability to signup multiple people.
Comment #36
ezra-g commented@brentratliff: You raise valid issues about using drupal_execute() vs user_save(), particularly that the right kind of email is are sent for new accounts.
We actually switched from using user_save() to drupal_execute in order to simplify form validation of required fields in #547242: Users can checkout without entering required profile fields. I think your patch in #16 is closer to the correct solution, but I'm open to why user_save() could be a better approach taking into account the validation issue. Otherwise I think we could preserve drupal_execute and add a few lines of code to make sure the right type of email is sent.
Comment #37
brentratliff commented@ezra-g,
I hadn't thought about that but I could see how user_save() could cause problems there. I agree, the patch in #16 works just fine. We can go with that for now so at least the one char password is fixed and work on the other logic separately.
Comment #38
bewhy commented@brentratliff thanks for telling me where i can edit the messages. I've been to that page but hadn't scrolled down to see all the goodies it can fiddle with (i.e. say "our little slice of the interwebs" a couple of times).
Comment #39
ezra-g commentedI changed language and the formatting of the code comments slightly to make them coding standards compliant, tested and committed.
Thanks, brentratliff!
http://drupal.org/cvs?commit=445276
Comment #40
brentratliff commentedThanks ezra-g. I need to work on coding standards ;-)