Fórum

[SOLVED] message BEFORE logout

thumbnail
lou cat, modificado 11 Anos atrás.

[SOLVED] message BEFORE logout

Regular Member Postagens: 196 Data de Entrada: 26/01/12 Postagens Recentes
Hi there!

I'd need to have a message (a pop-up window would be a good option, but not the only one) that asks the user if he really wants to logout, before actually logging out.
I've added a logout link in my side-navigation but I don't want that clicking in that page the user logs out directly.

Is there a quick way to do it? Is it something I can do editing a velocity template, a portal property, or adding an out-of-the-box portlet?

Thanks for any suggestion!
R V, modificado 11 Anos atrás.

RE: message BEFORE logout

New Member Postagens: 18 Data de Entrada: 11/01/12 Postagens Recentes
creating a hook for the jsp that has the logout action and having a confirm javascript dialog would be the way to go.
thumbnail
lou cat, modificado 11 Anos atrás.

RE: message BEFORE logout

Regular Member Postagens: 196 Data de Entrada: 26/01/12 Postagens Recentes
Thanks RV!

but what if I wanted the logout action to have a confirmation message when you click it on the side-navigation, and to act directly as usual when clicking in the dock of the portal?
Should I create 2 different logout actions?
thumbnail
lou cat, modificado 11 Anos atrás.

RE: message BEFORE logout

Regular Member Postagens: 196 Data de Entrada: 26/01/12 Postagens Recentes
Could I have more information on this, please?
I've tried to figure out how to do it but I'm still pretty new to hooks and similar...
It seems to me a normal need so I'm surprised there is no configuration file or something more easy to do in order to have a confirmation message instead of logging out directly emoticon

So, let's suppose I want to change the behaviour of every log out link... should I create a custom log out pre-action in order to show the pop up dialog box?
And is Javascript the only method I can use?
I know how to create a hook of an action but I don't know if I should call the dialog box inside its run method, calling a JSP or what... I'm pretty clueless at the moment and I haven't found much info on the web.

thanks!
thumbnail
Ali Shahrami, modificado 11 Anos atrás.

RE: message BEFORE logout

Junior Member Postagens: 52 Data de Entrada: 01/08/09 Postagens Recentes
Lou,

I'm not sure how you have added logout link to your side-navigation. See if this help:

- replace the logout href with "javascrip:void(0); Add a unique id to <a> tag
- use your favorite javascript api, ie jQuery to open a confirmation popup upon clicking on logout link. This script can be added to the theme.
- add the actual logout link to the confirm button.

Ali
thumbnail
lou cat, modificado 11 Anos atrás.

RE: message BEFORE logout

Regular Member Postagens: 196 Data de Entrada: 26/01/12 Postagens Recentes
Thank you very much Ali, now I got the ideas clearer emoticon
thumbnail
lou cat, modificado 11 Anos atrás.

RE: message BEFORE logout

Regular Member Postagens: 196 Data de Entrada: 26/01/12 Postagens Recentes
I used JQuery confirm() function linked to a tag with the normal $sign_out_url (instead of a href="javascript: void(0)"), and it works emoticon Thanks!