New Hook Request - COMPILER_BEFORE_OUTPUT [message #164978] |
Mon, 11 April 2011 15:11 |
|
Dayo
Messages: 101 Registered: April 2011
Karma:
|
Senior Member |
|
|
A hook placed after the forum has been loaded but BEFORE anything, including headers, has been sent, will be useful ... to me at least.
Getting tighter integration will be possible in my plugin could keep full track of requests.
For example, take this flow of events as it stands now...
- User requests Page X
- Core code determines user is not logged in
- User is redirected to login page
- Plugin uses COMPILER_FINALIZE_PAGE hook just before display
- Plugin send user to CMS login and feeds CMS with return params which in this case has to be front page as it has no way of knowing user actually wanted Page X.
- User is redirected to FUDforum Front page after login
Compared to ....
- User requests Page X
- Core code determines user is not logged in
- Plugin uses COMPILER_BEFORE_OUTPUT hook before redirection headers are sent
- Plugin sets session var "previous_request" as equal to "current_request" (which may be empty in which case "previous_request" will default to FUDforum front page) and then stores request url in session as "current_request"
- User is redirected to login page
- Plugin uses COMPILER_BEFORE_OUTPUT hook again
- Plugin sets session var "previous_request" as equal to "current_request" (which will not be empty) and then stores request url in session as "current_request"
- Plugin uses COMPILER_FINALIZE_PAGE hook just before display
- Plugin sends user to CMS login and feeds CMS with return params which in this case will be session var "previous_request".
- User is redirected to FUDforum Page X after login
The important thing is that the hook should be fired before anything is sent at all and preferably after GLOBALS.php has been loaded.
[Updated on: Mon, 11 April 2011 15:17] Report message to a moderator
|
|
|