Foros de discusión

Redirect user to custome site after login

Jason Dobyns, modificado hace 10 años.

Redirect user to custome site after login

Junior Member Mensajes: 36 Fecha de incorporación: 31/07/13 Mensajes recientes
Hi all,
I have created an organization, created a site and assign this site to above organization. I want after user of organization login, they will be redirect to site of organization.
Below are steps i did but didn't get success:
1. I created a hook
2. In file portal.properties i added these line
override.default.landing.page.path=true
custom.landing.page.type=organizationPublicPage
3. Deployed hook and login

But it always redirect me to default site of liferay.
venka reddy, modificado hace 10 años.

RE: Redirect user to custome site after login

Regular Member Mensajes: 231 Fecha de incorporación: 23/03/11 Mensajes recientes
Hi,

Below link can be useful

http://liferaytutorial.blogspot.in/2013/11/redirecting-user-default-landing-page.html
thumbnail
Pankaj Kathiriya, modificado hace 10 años.

RE: Redirect user to custome site after login

Liferay Master Mensajes: 722 Fecha de incorporación: 5/08/10 Mensajes recientes
I believe you are refering to Custom Landing Page Hook contributed in Marketplace by Tejas Kanani.

Make sure you have specified
login.events.post
property in hook's portal.properties properly.
Jason Dobyns, modificado hace 10 años.

RE: Redirect user to custome site after login

Junior Member Mensajes: 36 Fecha de incorporación: 31/07/13 Mensajes recientes
Hi Pankaj,
Yes, i am referring to "Custom Landing Page Hook contributed in Marketplace by Tejas Kanani"
But in his instruction doesn't mention to this "login.events.post"
thumbnail
Pankaj Kathiriya, modificado hace 10 años.

RE: Redirect user to custome site after login

Liferay Master Mensajes: 722 Fecha de incorporación: 5/08/10 Mensajes recientes
Please provide login.events.post as custom post action class path like [com.xxx.CustomLandingPageAction].

This class and property should already there in your hook got from Marketplace.
Jason Dobyns, modificado hace 10 años.

RE: Redirect user to custome site after login

Junior Member Mensajes: 36 Fecha de incorporación: 31/07/13 Mensajes recientes
Do we have to create this class "com.xxx.CustomLandingPageAction", if yes, can you give me an snippets source code?
thumbnail
Tejas Kanani, modificado hace 10 años.

RE: Redirect user to custome site after login

Liferay Master Mensajes: 654 Fecha de incorporación: 6/01/09 Mensajes recientes
Hi Jason,

I have created an organization, created a site and assign this site to above organization.

Can you please provide more detail on this ? If you can specify the steps that you would have followed for this.

1. I created a hook

Have you created the one on your own with your custom logic OR used the one available in Liferay Marketplace. (Custom Landing Page Hook). If you've created it yourself, It would be difficult to figure out the exact issue without looking into the code.

Thanks,
Tejas
Jason Dobyns, modificado hace 10 años.

RE: Redirect user to custome site after login

Junior Member Mensajes: 36 Fecha de incorporación: 31/07/13 Mensajes recientes
Hi Tejas,
In Liferay i did these:
1. Created a regular organization name "district", created new account and add into organization
2. Created a community site "district"
3. Assign organization "district" to site "district"
4. I did as your instruction at this link https://www.liferay.com/marketplace/-/mp/application/17676547
4.1 Created new hook plugin (with no java class to access action) "landingpage"
4.2 In source code of "landingpage", i created file portal.properties with content:
override.default.landing.page.path=true
custom.landing.page.type=organizationPublicPage
5. Deployed hook and logged in

Liferay didn't redirect me to organization public page.

Can you help me to figure this?
thumbnail
Tejas Kanani, modificado hace 10 años.

RE: Redirect user to custome site after login (Respuesta)

Liferay Master Mensajes: 654 Fecha de incorporación: 6/01/09 Mensajes recientes
I am putting down steps that you need to follow after 3rd step you have mentioned. It might help you.

4) Download the app from Liferay Marketplace.
- Go to https://www.liferay.com/marketplace/-/mp/application/17676547
- Click on Free button to initiate the download process
- Once done, you can download the actual packaged war from Your App Manager --> Custom Landing Page Hook --> Downloads. And download the one which fits your Liferay Version.
- Now you'll have downloaded file with .lpkg extension.
- Open that file using winzip/7-zip etc.
- You'll see CustomLandingPage-hook-*.war. Open it
- Now go to \WEB-INF\classes folder and open portal.properties
- Modify custom.landing.page.type property as per you requirement (i.e. custom.landing.page.type=organizationPublicPage)
- Save the file.
5) Deploy the app
- Copy the updated .lpkg file in your Liferay's deploy folder.
6) Login and check.

Thanks,
Tejas
Jason Dobyns, modificado hace 10 años.

RE: Redirect user to custome site after login

Junior Member Mensajes: 36 Fecha de incorporación: 31/07/13 Mensajes recientes
Thank Tejas,
It run fine now. Thank you so much!
thumbnail
Tejas Kanani, modificado hace 10 años.

RE: Redirect user to custome site after login

Liferay Master Mensajes: 654 Fecha de incorporación: 6/01/09 Mensajes recientes
It run fine now. Thank you so much!

Glad to hear that !! emoticon

Thanks,
Tejas Kanani
Sr. Consultant @ CIGNEX Datamatics
http://www.opensourceforlife.com
Moha obarm, modificado hace 9 años.

RE: Redirect user to custome site after login

New Member Mensaje: 1 Fecha de incorporación: 7/06/13 Mensajes recientes
hi Tijas Kanani
Im a junior developper
i creat a site organization under that organization, i didnt refer to an independante site.
i did all step by step and that work very fine , thank you very much .
BUT if i want to link an independante site to an organization which don't have its own site. i don't get the direct loging independante page when login with that user who belongs to that organiszation. i just get the same home portal page.
i m wondering why ! is there any idea how can i do that without creationg another site within organazation !!

thank you
M
thumbnail
Joseph Toman, modificado hace 10 años.

RE: Redirect user to custome site after login

Junior Member Mensajes: 25 Fecha de incorporación: 28/01/11 Mensajes recientes
I had this situation, and though I found the various login redirecting hook info that others have linked to, in the end I just went old school. My situation was redirecting users to their dashboard page after login, so I created a redirect page and a redirect piece of web content and template to get the user's ID, figure out where their dashboard was, and run some javascript to redirect to it. Then I set that page as the default post-login landing page in the portal configuration. Simple, configurable, no WAR file to deploy. You don't always need the biggest hammer possible.