Functionality for saving/reading "last forward from" url
|Reported by:||juho.jaakkola||Owned by:|
|Priority:||normal||Milestone:||Near Term Future Release|
Elgg core uses a session variable called last_forward_from. The variable is given value in gatekeeper() and admin_gatekeeper() functions and it is read in "action/login" action.
The purpose being:
- Non-logged-in user tries to access privileged page
- Access is denied
- The url of the page is saved to $_SESSION("last_forward_from")
- User is forwarded to Elgg front page
- User signs in
- The last_forward_from variable is checked and if value is found the user is forwarded back to the page that denied access in the first place
So far the variable is meant to be used only internally by the engine. There would be however need for similar variable to be used by plugin developers when developing authentication plugins which implement third party authentication.
After successful authentication the plugin would read the variable and forward user back to the page where the authentication was requested.
So there's a need for example for a wrapper function saving/reading the $_SESSIONlast_forward_from? variable. It could be named for example "set_forward_url" or "set_sticky_url" etc.