Fórum

Help with login portlet

thumbnail
Esteban Gomez, modificado 9 Anos atrás.

Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Hi liferay people, I have a problem with a portlet login, I need redirect to the user a other page different to the default ( in this case, I need redirect to the dashboard of the social office user) but, I don´t know how do it? I see some things, but I didn´t not find nothing, I can do it with a other portlet or with a hook o ext? and how I can do it? thanks very much for your answers.
thumbnail
Jeffrey Paul Handa, modificado 9 Anos atrás.

RE: Help with login portlet

Liferay Master Postagens: 541 Data de Entrada: 01/12/08 Postagens Recentes
Hi Esteban,

To control the landing page that someone sees after successful login, take a look at the Default Landing Page section in portal.properties.
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Hi Jeffrey, thanks for answer, but, you maybe could show me more about it? I try to find that, but I did not get result, thanks again.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Help with login portlet

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Esteban,

Is this what you tried?

1. Add to your portal-ext.properties file --

default.landing.page.path=<the full url here> (eg. http://www.google.com)

2. Save and close the file.
3. Restart the server.

(You could also do this under the site settings in the control panel to avoid having to do the server restart)
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Andew Hi, Thanks for answer, I have a question, Where should I create the file? (the location), thanks.
thumbnail
Tanweer Ahmed ., modificado 1 Ano atrás.

RE: Help with login portlet

Expert Postagens: 322 Data de Entrada: 11/03/10 Postagens Recentes
Hi Esteban,

You can create it inside of your Liferay home folder.You can also create it inside of ROOT/WEB-INF/classes of your liferay portal.

-Tanweer
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Hi Tanweer, I did it, but, when I sign, the page doesn't load, that is, when I refresh the page effectively start session, the problem is when the user sign in, the page doesn´t redirect.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Help with login portlet

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
As Tanweer has said, there are two places though I would not recommend putting it in the WEB-INF/classes of the ROOT application. LIFERAY_HOME is the way to go -- which is one level up from tomcat -- or rather the same level as the tomcat folder.

For example, mine has it in --

/data
/deploy
/license
/logs
/tomcat-7.0.47
readme.html
portal-ext.properties
portal-ide.properties
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Hi, any of you know how placing the user in the file portal-ext.properties, for example:

default.landing.page.path=/user/Here I need placing the user, but, I don´t know how do it/red-convive


Thanks!!
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Help with login portlet

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Esteban,

Are you asking how to dynamically change the user based on how the logged in user is? Meaning, assuming you have the following users --

userA
userB
userC

and the server is --

http://my.hostname:8080

then you want the redirection for each user as follows --

userA http://my.hostname:8080/user/userA
userB http://my.hostname:8080/user/userB
userC http://my.hostname:8080/user/userC

.. is that right? If that is the case then I don't think you can do this with the default.landing.page property. You would need to create a post login hook for a custom default landing page action and configure it in the portal-ext.properties file (like this) --


login.events.post=com.liferay.portal.events.CustomDefaultLandingPageAction


In CustomDefaultLandingPageAction, you can set your path variable which redirects to /user/<user screen name>/<page> .
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Hi Andew it is exactly that I need, but I have a question, you can tell me, how should I configure the hook? I know as create the hook, but, how do I the configure it with the login? thanks again.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Help with login portlet

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hi Esteban,

Looking at the DefaultLandingPageAction (https://github.com/liferay/liferay-portal/blob/5a5b08bddc8617871814ccda33d8d8e2c8bd969e/portal-impl/src/com/liferay/portal/events/DefaultLandingPageAction.java), in the vicinity of line #73 looks promising.

Try setting, in your portal-ext.properties file,


default.landing.page.path=/user/${liferay:screenName}/home


I think that might yield what you are looking for without requiring any custom hooks.
thumbnail
Esteban Gomez, modificado 9 Anos atrás.

RE: Help with login portlet

Junior Member Postagens: 34 Data de Entrada: 14/10/14 Postagens Recentes
Andew Thanks so much, it helped me really, in my company we needed it.