Fórum

redirect after logout

evan cheung, modificado 12 Anos atrás.

redirect after logout

Junior Member Postagens: 81 Data de Entrada: 17/04/08 Postagens Recentes
Hi,

I am using portal 6.0.6, how do I redirect to a different page after user click on signout?
On 5.2.3, I just added <a href="$sign_out_url?referer=/web/xyz/">Sign out</a> and it works, but on the new version it always goes back to /web/guest/.
Can you help?

thanks,
Evan
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: redirect after logout

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
I believe it is now a parameter in portal-ext.properties to indicate where to go on logout.
Paul Butenko, modificado 12 Anos atrás.

RE: redirect after logout

Junior Member Postagens: 38 Data de Entrada: 02/07/10 Postagens Recentes
Hi,
Under Control panel - Portal settings - Default Logout Page you can define where User should be redirected after logout.
Or try redirect parameter instead of referer.

BR,
Paul Butenko
evan cheung, modificado 12 Anos atrás.

RE: redirect after logout

Junior Member Postagens: 81 Data de Entrada: 17/04/08 Postagens Recentes
Hi,

Thanks for your info. In my situation, I have two communities, I want to configure each one to go to their own home page when user click signout. Can you please tell me how to do it? How do you use parameter? Can you please provide an example?

thanks,
Evan
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: redirect after logout

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
This you'd probably have to do using a hook. The logout is a site-level setting, not a community-based setting.
evan cheung, modificado 12 Anos atrás.

RE: redirect after logout

Junior Member Postagens: 81 Data de Entrada: 17/04/08 Postagens Recentes
Really? Like I said I used to be able to use <a href="$sign_out_url?referer=/web/xyz/">Sign out</a> on portal 5.2.3. I wish there would be an alternative way instead of writing customized code for this.

thanks,
Evan
evan cheung, modificado 12 Anos atrás.

RE: redirect after logout

Junior Member Postagens: 81 Data de Entrada: 17/04/08 Postagens Recentes
FYI ---
I got it working using referer as I indicated before. All you have to do is change the "referer_js.jsp" file under /root/html/common/ and set the javascript as the following:

<script type="text/javascript">
location.href = '<%=referer%>';
</script>

thanks,
Evan
thumbnail
David H Nebinger, modificado 12 Anos atrás.

RE: redirect after logout

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Yes, but to do this properly you would have created a hook to override the referer_js.jsp page to get it into place...

Hopefully you didn't edit the file inline...
thumbnail
Warachot D, modificado 9 Anos atrás.

RE: redirect after logout

New Member Postagens: 2 Data de Entrada: 10/01/13 Postagens Recentes
Do you have the solution?
Could you please share?
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: redirect after logout

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
He did give the solution.