How to Log in a user
Hello, I am hacking the user.module to integrate better with my hacked version of the ecommerce module :). I would like to automatically redirect the user after creating a new account to the next step in the shopping cart. I am having problems tracking down the code that will allow my new user to login without having to fill in a form and press the login button. I already have the user name and password. So I would like to preform the following: 1. Detect if the action came from the shopping cart. I am successfull in this by parsing drupal_get_ destination for cart/checkout. 2. I would like to automatically check the user in without their interaction. I need help with this one. 3. Automatically redirect the user to the next step in the shopping cart. I need some help with this one. Thanks for your help.
Is this the right list to ask about hacking a module? On February 27, 2006 02:44 am, stuff@trackingsolutions.ca wrote:
Hello,
I am hacking the user.module to integrate better with my hacked version of the ecommerce module :).
I would like to automatically redirect the user after creating a new account to the next step in the shopping cart.
I am having problems tracking down the code that will allow my new user to login without having to fill in a form and press the login button. I already have the user name and password. So I would like to preform the following:
1. Detect if the action came from the shopping cart. I am successfull in this by parsing drupal_get_ destination for cart/checkout.
2. I would like to automatically check the user in without their interaction. I need help with this one.
3. Automatically redirect the user to the next step in the shopping cart. I need some help with this one.
Thanks for your help.
On 27/02/06, stuff@trackingsolutions.ca <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
One of Drupal's aphorisms is that you _never_ hack core on a production site :) I suggest you backtrack and take this from the top or suffer aeons of pain come upgrade time. My 10p, -K
Thanks for the Drupal aphorism."_never_hack core on a production site" I am brand new to this game, and I love it already. Drupal is the best CMS, no question, right? Oh no, i just questioned it...LOL.... This aphorism makes a lot of sense if you are trying to build in a community where people are working together on certain projects and not just tearing each others work apart for personal use. Now don't get me wrong I love the daily hack or two, but maybe this guy "stuff@ts.ca" is just using the wrong word? How can he solve his problems without hacking the module? Thanks Gals & Guys! One, erik ---------------------- Erik Ebright Interactive Media Developer http://www.eeeb.com Karthik wrote:
On 27/02/06, stuff@trackingsolutions.ca <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
One of Drupal's aphorisms is that you _never_ hack core on a production site :) I suggest you backtrack and take this from the top or suffer aeons of pain come upgrade time.
My 10p, -K
I understand this methodology however I am finding that drupal sometimes had critical flaws in it's implementation that stop you from moving forward. example: drupal_get_destination() is rewritten in 4.7 to handle the get variables properly. I upgraded my functions 4.6 code to the 4.7 code and now it works. Am I supose to just ignore the short commings or code arround them? I love how much time drupal has saved me but there has been some real stoppers. I have been stuck on very simple problems that have turned out to be drupal bugs. I guess I am not the type to stop on something when I do not have what I want. When I need to upgrade I will way the cost and run diff! :) On that note I have tracked the function down to the user.module and the user_login function. Am I correct? Thanks P.S. Porting Drupal to JSP/Servlet would be so powerful. It would allow for total seperation of layers and become much more maintainable. Just a dream of mine :) On February 27, 2006 03:15 am, Karthik wrote:
On 27/02/06, stuff@trackingsolutions.ca <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
One of Drupal's aphorisms is that you _never_ hack core on a production site :) I suggest you backtrack and take this from the top or suffer aeons of pain come upgrade time.
My 10p, -K
On Mon, 27 Feb 2006 11:10:16 +0100, <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
On February 27, 2006 02:44 am, stuff@trackingsolutions.ca wrote:
Hello,
I am hacking the user.module to integrate better with my hacked version of the ecommerce module :).
I would like to automatically redirect the user after creating a new account to the next step in the shopping cart.
I would suggest using logintoboggan module instead of hacking apart user.module.
I tried logintoboggan. It was outputting my drupal set message to the screen about 15 times in a list. I tried to get it working and then asked myself. "Self would you rather hack logintoboggan or the user.module". I choose the user.module because it only need minor changes. On February 27, 2006 03:30 am, Karoly Negyesi wrote:
On Mon, 27 Feb 2006 11:10:16 +0100, <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
On February 27, 2006 02:44 am, stuff@trackingsolutions.ca wrote:
Hello,
I am hacking the user.module to integrate better with my hacked version of the ecommerce module :).
I would like to automatically redirect the user after creating a new account to the next step in the shopping cart.
I would suggest using logintoboggan module instead of hacking apart user.module.
On Mon, 27 Feb 2006 11:40:27 +0100, <stuff@trackingsolutions.ca> wrote:
I tried logintoboggan. It was outputting my drupal set message to the screen about 15 times in a list. I tried to get it working and then asked myself. "Self would you rather hack logintoboggan or the user.module". I choose the user.module because it only need minor changes.
*shrug* you are free to ignore my advice.
I just fixed it! I know it is a hack but it is awesome customer purchase flow and it is such a minor change. With a small diff and half an our I should be able to upgrage easily. <code> if(ereg("cart/checkout", urldecode(drupal_get_destination()))) { //1. Login new user here $tsiedit['name'] = $account->name; $tsiedit['pass'] = $pass; user_login($tsiedit); $mytext = 'Your account has been created. For security purposes you have been sent an e-mail with your account information. Click the Checkout button below to and enter your account information from the e-mail'; $mytext .= '<br/><br/>'; $mytext .= '<a href="?q=cart/checkout"><img src="themes/tsilinux/images/checkout.png" ></a>'; return $mytext; } else { //This is the original flow. I go here if the request is not from the cart return t('Your password and further instructions have been sent to your e-mail address.'); } </code> Thanks
I formatted the shopping cart to look really nice and added some graphics. I also created a quick buy block that interfaces with the shopping cart to allow a user to click once and checkout at the same time. As well is my latest invention. The ability to register your user in the cart and continue the checkout process without having to check their e-mail and have to come back to login, taking the same checkout steps over again. I also integrated the drupal_get_destination code from 4.7 into 4.6. It all works great. I am not finished my hacking but I believe that this cart is by far more functional and user friendly. Are my hacks of interest to drupal? If so I would like to help give back. Please let me know. Thanks On February 27, 2006 04:00 am, stuff@trackingsolutions.ca wrote:
I just fixed it!
I know it is a hack but it is awesome customer purchase flow and it is such a minor change. With a small diff and half an our I should be able to upgrage easily.
<code>
if(ereg("cart/checkout", urldecode(drupal_get_destination()))) { //1. Login new user here
$tsiedit['name'] = $account->name; $tsiedit['pass'] = $pass; user_login($tsiedit);
$mytext = 'Your account has been created. For security purposes you have been sent an e-mail with your account information. Click the Checkout button below to and enter your account information from the e-mail'; $mytext .= '<br/><br/>'; $mytext .= '<a href="?q=cart/checkout"><img src="themes/tsilinux/images/checkout.png" ></a>';
return $mytext; } else { //This is the original flow. I go here if the request is not from the cart return t('Your password and further instructions have been sent to your e-mail address.'); }
</code>
Thanks
Your hacks are of interest to me, currently i am working on a project rootsnetwork.org and am looking into some kinda of shopping cart ecomm solution to help support artists and the site. If you think your method is better than previous methods for drupal ecomm then by all means help me out with some code or something. Good looks. -eeeb. stuff@trackingsolutions.ca wrote:
I formatted the shopping cart to look really nice and added some graphics. I also created a quick buy block that interfaces with the shopping cart to allow a user to click once and checkout at the same time. As well is my latest invention. The ability to register your user in the cart and continue the checkout process without having to check their e-mail and have to come back to login, taking the same checkout steps over again. I also integrated the drupal_get_destination code from 4.7 into 4.6.
It all works great. I am not finished my hacking but I believe that this cart is by far more functional and user friendly. Are my hacks of interest to drupal? If so I would like to help give back. Please let me know.
Thanks
On February 27, 2006 04:00 am, stuff@trackingsolutions.ca wrote:
I just fixed it!
I know it is a hack but it is awesome customer purchase flow and it is such a minor change. With a small diff and half an our I should be able to upgrage easily.
<code>
if(ereg("cart/checkout", urldecode(drupal_get_destination()))) { //1. Login new user here
$tsiedit['name'] = $account->name; $tsiedit['pass'] = $pass; user_login($tsiedit);
$mytext = 'Your account has been created. For security purposes you have been sent an e-mail with your account information. Click the Checkout button below to and enter your account information from the e-mail'; $mytext .= '<br/><br/>'; $mytext .= '<a href="?q=cart/checkout"><img src="themes/tsilinux/images/checkout.png" ></a>';
return $mytext; } else { //This is the original flow. I go here if the request is not from the cart return t('Your password and further instructions have been sent to your e-mail address.'); }
</code>
Thanks
stuff@trackingsolutions.ca wrote:
It all works great. I am not finished my hacking but I believe that this cart is by far more functional and user friendly. Are my hacks of interest to drupal? If so I would like to help give back. Please let me know.
As someone who buys online, I'm strongly of the opinion that making me register before giveing you money is the least user-friendly decision you could possibly make. I see that on any store, and I'm gone. Probably to your direct competitor. [sorry, drifting OT now] jh
On 27 Feb 2006, at 3:38 PM, John Handelaar wrote:
I see that on any store, and I'm gone. Probably to your direct competitor.
[sorry, drifting OT now] guess you won't be buying anything from amazon or any of the other large and trustworthy online stores then.
-- Adrian Rossouw Drupal developer and Bryght Guy http://drupal.org | http://bryght.com
Adrian Rossouw wrote:
On 27 Feb 2006, at 3:38 PM, John Handelaar wrote:
I see that on any store, and I'm gone. Probably to your direct competitor.
[sorry, drifting OT now]
guess you won't be buying anything from amazon or any of the other large and trustworthy online stores then.
Utterly wrong. Amazon does *not* force me to confirm an email address and register before buying. jh
On 27-Feb-06, at 6:29 AM, John Handelaar wrote:
Adrian Rossouw wrote:
On 27 Feb 2006, at 3:38 PM, John Handelaar wrote:
I see that on any store, and I'm gone. Probably to your direct competitor.
[sorry, drifting OT now] guess you won't be buying anything from amazon or any of the other large and trustworthy online stores then.
Utterly wrong.
Amazon does *not* force me to confirm an email address and register before buying.
And neither does logintoboggan if you go that route. -- Boris Mann Vancouver 778-896-2747 San Francisco 415-367-3595 SKYPE borismann http://www.bryght.com
And neither does logintoboggan if you go that route.
And neither does core once this patch goes in. The issue takes some twists and turns but the patch is at the end: http://drupal.org/node/4942
That is why the hack to user to log them in is important. However, without verifying that the email address is valid, any purchases are at least slightly suspect. It is very frustrating to our order processing people (on a non-drupal system) to have a problem with an order and not be able to contact them with email, e.g. notifying them of a backorder, or problems with them trying to buy at member rates when they aren't a member.
-----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of John Handelaar Sent: Monday, February 27, 2006 9:30 AM To: development@drupal.org Subject: Re: [development] How to Log in a user
Adrian Rossouw wrote:
On 27 Feb 2006, at 3:38 PM, John Handelaar wrote:
I see that on any store, and I'm gone. Probably to your direct competitor.
[sorry, drifting OT now]
guess you won't be buying anything from amazon or any of the other large and trustworthy online stores then.
Utterly wrong.
Amazon does *not* force me to confirm an email address and register before buying.
jh
There is very little difference between registering and filling out enough fields on the order form to get something shipped to you (generally more info as the snail mail address may not be needed to become a registered user.) So why not register them as a side effect of ordering, and while you are at it mark them as having ordered from you in the past. This makes future marketing efforts easier.
-----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of John Handelaar Sent: Monday, February 27, 2006 8:39 AM To: development@drupal.org Subject: Re: [development] How to Log in a user
stuff@trackingsolutions.ca wrote:
It all works great. I am not finished my hacking but I believe that this cart is by far more functional and user friendly. Are my hacks of interest to drupal? If so I would like to help give back. Please let me know.
As someone who buys online, I'm strongly of the opinion that making me register before giveing you money is the least user-friendly decision you could possibly make.
I see that on any store, and I'm gone. Probably to your direct competitor.
[sorry, drifting OT now]
jh
On Mon, 2006-02-27 at 03:40 -0700, stuff@trackingsolutions.ca wrote:
I tried logintoboggan. It was outputting my drupal set message to the screen about 15 times in a list. I tried to get it working and then asked myself. "Self would you rather hack logintoboggan or the user.module". I choose the user.module because it only need minor changes.
On February 27, 2006 03:30 am, Karoly Negyesi wrote:
On Mon, 27 Feb 2006 11:10:16 +0100, <stuff@trackingsolutions.ca> wrote:
Is this the right list to ask about hacking a module?
On February 27, 2006 02:44 am, stuff@trackingsolutions.ca wrote:
Hello,
I am hacking the user.module to integrate better with my hacked version of the ecommerce module :).
I would like to automatically redirect the user after creating a new account to the next step in the shopping cart.
I would suggest using logintoboggan module instead of hacking apart user.module.
You may look at logintoboggan as an example of how to take over the user_login process, and modify the default behavior of user.module in an external module just as logintoboggan does without altering the core distribution... :)
Hi, Take a look at logintoboggan I think this will help you be able to login without too much trouble. The other thing that could be done is add something to the top of the list that will log in the user using the checkoutapi(). Coupled with logintoboggan I don't think it will be too hard to do this, without changing core of Drupal or E-Commerce. Gordon. On Mon, 2006-02-27 at 02:44 -0700, stuff@trackingsolutions.ca wrote:
Hello,
I am hacking the user.module to integrate better with my hacked version of the ecommerce module :).
I would like to automatically redirect the user after creating a new account to the next step in the shopping cart.
I am having problems tracking down the code that will allow my new user to login without having to fill in a form and press the login button. I already have the user name and password. So I would like to preform the following:
1. Detect if the action came from the shopping cart. I am successfull in this by parsing drupal_get_ destination for cart/checkout.
2. I would like to automatically check the user in without their interaction. I need help with this one.
3. Automatically redirect the user to the next step in the shopping cart. I need some help with this one.
Thanks for your help.
!DSPAM:1000,4402d05c274721670870668!
participants (11)
-
Adrian Rossouw -
Boris Mann -
Darrel O'Pry -
Erik B. Ebright -
Gordon Heydon -
John Handelaar -
Karoly Negyesi -
Karthik -
Moshe Weitzman -
stuff@trackingsolutions.ca -
Walt Daniels