Hi Orsatio,
Orstio wrote:
Sorry for the new topic, but the other is locked.
No problem, let's use this thread to start fresh.
Quote:
obExit sometimes gets called from a function named is_not_guest. This function is used in cases like the PMs (not the only example, but the example I will use to explain).
is_not_guest checks to see if the user is logged in. If the user is logged in, it returns. If not, it loads the login template, and calls obExit to exit without returning to the PM page-rendering.
Now, if obExit returns to is_not_guest, then is_not_guest will return to the PM page-rendering, and despite the error message generated by a guest trying to access PMs, the PM page will be displayed anyway.
This is a problem indeed. It means under these circomstances we cannot delay the exit using an event handler in Joomla! 1.5.
As a side note, it feels a bit strange that a function called 'is_not_guest' could force a script to exit. Wouldn't it be better to let it return a boolean to inform the caller if the user is a guest or not. Let the caller then decide what he needs to do with that information. This would definitly make the function alot more flexible and universal.
Quote:
There may still be one way, but it will take me some time. The code I posted in the other topic would be what I would be attempting to make work, as I said, by adding in the code that would normally happen after the component execution. Now. please note that I say may be a way, as long as I can in fact wrap all that up inside a function in the component.
While this technically could be done, it feels very unnatural. What you would be doing is allowing Joomla! to boot up, starts it's application flow and right in the middle you would interupt it, let your smf component take over and from that point your component and not Joomla! would drive the execution flow. That's smells a bit like appliaction hijacking to me.
I think that this solution should only be looked at as the worst case scenario.. By letting smf taken over you would be mixing two security models and you could potentially run into BC issues in later releases of Joomla! 1.5.x as the point where you take over could change up or down resulting in a needed change in your code.
I think that you should strive to a solution that doesn't require you to hijack Joomla!. I ca, see two possible options, either Joomla! drives the application flow, or SMF does. Or said otherwise, you either integrate SMF into Joomla! or you integrate Joomla! into SMF.
You could try exploring to do something like a special entry file that would fire up SMF and integrate Joomla! in it. You could derive you own JApplication class much like the JSite app. In this case SMF would be in full control of the excution flow and could decide to exit at any time. Just an idea ...
