I'm creating a bridge for SMF and Magento, and the Magento to SMF portion is complete. The other side is a real pain because I need a way to open a Magento session from 'within' an SMF session and securely pass a couple variables to the new session. I can't just close the SMF session. The good folks at SimpleMachines are at a loss and the Magento forums, you probably know how that is :D
I could open a new window and run the new session, but some people's browsers block new windows so that wouldn't be a great solution for me. I just need to run some code, I do not need any output, do not care about any errors. A sample of what I want to run outside my SMF session is below. It will just log the already authenticated smf user into Magento.
In SMF, this is going to run immediately after the 'integrate login hook', so the headers won't have been sent and the SMF script will be just about to redirect and set it's login cookie (so there can't be any output).
I have put this 2nd script in another file in the same directory and tried opening it with exec() with no success. exec() works for commands like ls and whoami but I didn't get it to work opening this file, not sure why or if this is a good idea. I am using godaddy shared hosting if it makes a difference.
I tried curl, but it looks like curl treats the called script like an include so that didn't work. Is there any way to call this file and run it in the background without opening a window? Or running it in an iframe? Or running it from within SMF's session handler (not likely according to them)? Any suggestions, theories, wild guesses or anything on how to do this would really be appreciated. I've been banging my head on this for weeks now :/
$app = Mage::app("default");
$session = Mage::getSingleton('customer/session');
$customer = Mage::getModel('customer/customer')
$customer->loadByEmail($email);//will need to pass this from SMF session
exit(); //or die or return or whatever