We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

member_member_register hook and automatic login

Development and Programming

George Ornbo's avatar
George Ornbo
272 posts
18 years ago
George Ornbo's avatar George Ornbo

I’ve written an extension to send user information to various places when a member registers on the user side. The code works fine but for one thing.

Member activation is set to No Activation Required. When the user completes registration they should be logged in.

With the extension everything works fine but the user is not logged in. To debug I have removed all additional code from the extension and now just have the exact code from the core. Still the user is not logged in.

I’m sure I’ve declared all the global constants required. I’m really struggling to debug this so if anyone could offer some insight it would be gratefully appreciated. The logging in starts at line 85 and I can’t see anything that should stop the session from being written.

Debugging version of extension attached

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
18 years ago
Mark Bowen's avatar Mark Bowen

Hi there Shape Shed,

Pretty interested in seeing how this works and what exactly it does. How do I go about testing out the extension in the post above. I have enabled it in the extensions panel but just wondering what it will do?

Regards,

Mark

       
George Ornbo's avatar
George Ornbo
272 posts
18 years ago
George Ornbo's avatar George Ornbo

Hi Mark,

I’ve actually removed the code that does the business from the posted extension in order to try and debug.

The code sends user information via cURL (which needs to be compiled on your server) to scripts expecting POST information. If you have a signup form at /member/register it will take over and send the information to other places as well as register the user.

I’m using it to submit user information to SalesForce and also ListMailPro during the signup process.

BUT I just can’t seem to clear this last bug which doesn’t log the user in automatically upon completion. The code is an exact replica of the core but moving it to an extension seems to cause an issue.

If I can debug this I’ll eventually publish the extension.

       
Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

Hi Shape, the extension call is passing $data along to your extension, but you’ve not reflected that in your functions arguments.

Try:

function redirect_registered_user($data)
    {
       
George Ornbo's avatar
George Ornbo
272 posts
18 years ago
George Ornbo's avatar George Ornbo

the_butcher - I think this is the second time I have had to say thank you.

Of course - why didn’t I see that. All working perfectly now thanks. Will package it up and prepare for a release.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.