Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jason Dobyns
Redirect user to custome site after login
November 12, 2013 8:57 PM
Answer

Jason Dobyns

Rank: Junior Member

Posts: 36

Join Date: July 30, 2013

Recent Posts

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
RE: Redirect user to custome site after login
November 12, 2013 9:06 PM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,

Below link can be useful

http://liferaytutorial.blogspot.in/2013/11/redirecting-user-default-landing-page.html
Pankaj Kathiriya
RE: Redirect user to custome site after login
November 12, 2013 9:07 PM
Answer

Pankaj Kathiriya

Rank: Liferay Master

Posts: 697

Join Date: August 4, 2010

Recent Posts

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.
Tejas Kanani
RE: Redirect user to custome site after login
November 12, 2013 10:15 PM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

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
RE: Redirect user to custome site after login
November 12, 2013 11:48 PM
Answer

Jason Dobyns

Rank: Junior Member

Posts: 36

Join Date: July 30, 2013

Recent Posts

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?
Jason Dobyns
RE: Redirect user to custome site after login
November 12, 2013 11:50 PM
Answer

Jason Dobyns

Rank: Junior Member

Posts: 36

Join Date: July 30, 2013

Recent Posts

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"
Pankaj Kathiriya
RE: Redirect user to custome site after login
November 13, 2013 12:09 AM
Answer

Pankaj Kathiriya

Rank: Liferay Master

Posts: 697

Join Date: August 4, 2010

Recent Posts

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
RE: Redirect user to custome site after login
November 13, 2013 12:06 AM
Answer

Jason Dobyns

Rank: Junior Member

Posts: 36

Join Date: July 30, 2013

Recent Posts

Do we have to create this class "com.xxx.CustomLandingPageAction", if yes, can you give me an snippets source code?
Tejas Kanani
RE: Redirect user to custome site after login
November 13, 2013 12:17 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

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
RE: Redirect user to custome site after login
November 13, 2013 7:03 AM
Answer

Jason Dobyns

Rank: Junior Member

Posts: 36

Join Date: July 30, 2013

Recent Posts

Thank Tejas,
It run fine now. Thank you so much!
Joseph Toman
RE: Redirect user to custome site after login
November 13, 2013 11:09 AM
Answer

Joseph Toman

Rank: New Member

Posts: 23

Join Date: January 28, 2011

Recent Posts

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.
Tejas Kanani
RE: Redirect user to custome site after login
November 14, 2013 12:53 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

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
RE: Redirect user to custome site after login
July 4, 2014 3:31 AM
Answer

Moha obarm

Rank: New Member

Posts: 1

Join Date: June 7, 2013

Recent Posts

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