Changed module allow user-defined post-registration destination - but I can't get one thing working
| Project: | Login Destination |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Hi,
After looking at this help request and because I wanted the same functionality, I had a go at altering your module (see attached .module file - sorry, I don't have CVS software, you'll have to run it through your own.)
The changes I've made:
1. Added new options in the admin settings page to include 'registration destination' options.
2. Added an implementation of hook_user that goes to the chosen url / php function when $op == 'insert' && ldreg_condition_type != never.
3. I also added another option of 'never' for each, so that folk can choose to revert back to no redirect.
The problem: whilst for registration, it does write a new user to the database, it doesn't log them in automatically. You're taken to your chosen page, but not logged in. That's fine for me currently because I want my users to get admin approval before using their account, and just want a bespoke page telling them what will happen next. But ideally it just use the site's default of 'awaits admin approval' or logged straight in.
Any ideas how this could be achieved? I'm guessing its really straightforward, but after much poking about I'm not sure how. I can't even find where 'insert' adds module-defined code in user.module. Where is it?
I presume it's because I'm calling another url before 'insert' gets to finish - but if that's the case, why does it add the user to the database, but not log the user on? Seems somewhat arbitrary.
p.s. I haven't managed to find this functionality elsewhere, so I hope you don't mind me having a go at your module!
All the best
Dan
| Attachment | Size |
|---|---|
| login_destination.zip | 1.98 KB |
