Needs some help being pointed in the right direction.
I am working on a Continuing Education ( CE ) hours manager for a non-profit Assocation, the issue I am coming up with is when a member completes a local workshop we are planing on handing them a business card with a QR code ( URL encoded: http://URL/workshop/WORKSHOP_ID/UNIQUE_ID ) as well as the workshop_ID and the Unique_ID and the name of the workshop for manual entry
what I need or more pointed in the right direction for is when they follow the QR ( most likely with a phone or other handled ) they will not already be login so I need the page to redirect them to a log-in page once login go to the confirmation page for the work they just completed or to a testing page
this is being developed on Drupal6 as pure custom modules due to performance reasons
Shawn
Comments
Have you looked at the Login Destination module?
http://drupal.org/project/login_destination
Thanks
No I hadn't really looked at in the modules page for an existing module. but at least I should be able to use it as reference to build what I need
Again Thanks
Shawn
Destination parameter
You can also pass in the destination parameter in the URL, which user/login supports.
http://my.site/user/login?destination=some/path/to/a/page
On second thought, login destination is the way to go anyway because in your case you could already be logged in.
I will look into the
I will look into the ?destination args as well.
Thanks
Shawn
Drupal_goto
Shawn,
If you're going to write your own module to handle redirects you will probably end up using
drupal_goto()
see http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_go...
I rather imagine this will be a module that uses hook_init to get triggered on every page load. Here's some pseudo code for you that assumes your module name is "shawn."
shawn_init() {
global $user;
if ($user->uid ==0) drupal_goto(the loggin page);
return;
}
In this example NO anonymous user can ever land on any page except the log in page. Or more acurtaely any page the anonymous user goes to will immediately redirect them to the loggin page.
If that is what you want then the above code get's u almost there.
;-)
Doug, here is what I think I
Doug,
here is what I think I am going to end up with
_init() {
global $user;
if ($user->uid ==0) drupal_goto("user/login" , "destination=workshops/$workshopID/$MyID" );
return;
}
see any reason why that wouldn't work or is it going to do what I expect it to?
Looks good
So long as $MyID is assigned somewhere.
Let me know how that goes.
Thanks for your Help
Doug,
Just wanted to say thanks, its going to be a while before I can be sure that it works the way that I need it to as I still need to write 3 forms and a hand full custom interactions to get it all working
so, Thank you very much.
Shawn