valan Posted October 18, 2013 Posted October 18, 2013 I have the following scenario: User receives email with link that has GET parameters (smth like http://mysite.com/mailbox/?message=1234). Since user doesn't have access to this page (e.g. not logged in), first of all, system should redirect him to login page (e.g. to http://mysite.com/login/) and only after succesful login - redirect user to initial link. First redirect can be configured in PW template access settings. However, as far as I understand, optional {id} tag will only be replaced with page ID (e.g. http://mysite.com/mailbox/), but GET parameters (e.g. message=1234) will be lost. So, how to receive these GET parameters (message=1234) in http://mysite.com/login/ ?
Wanze Posted October 18, 2013 Posted October 18, 2013 You can code the redirect yourself instead setting it in the templates access settings: if (!$user->isLoggedIn()) { $session->redirect($pages->get('/login/')->url . '?message=' . (int)$input->get->message); } Or store the message ID in a session variable and read it out on your login page. (Code not tested... ) 3
valan Posted October 18, 2013 Author Posted October 18, 2013 Wanze, thanks! Yes, own coding is solution. I just think that this is a typical scenario. Therefore it is better to have it "in PW template settings", e.g. adding {url} tag (by analogy to available {id} tag) which may be replaced by original URL string value.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now