留言板

Redirect user to custome site after login

Jason Dobyns,修改在10 年前。

Redirect user to custome site after login

Junior Member 帖子: 36 加入日期: 13-7-31 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Regular Member 帖子: 231 加入日期: 11-3-23 最近的帖子
Hi,

Below link can be useful

http://liferaytutorial.blogspot.in/2013/11/redirecting-user-default-landing-page.html
thumbnail
Pankaj Kathiriya,修改在10 年前。

RE: Redirect user to custome site after login

Liferay Master 帖子: 722 加入日期: 10-8-5 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Junior Member 帖子: 36 加入日期: 13-7-31 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Liferay Master 帖子: 722 加入日期: 10-8-5 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Junior Member 帖子: 36 加入日期: 13-7-31 最近的帖子
Do we have to create this class "com.xxx.CustomLandingPageAction", if yes, can you give me an snippets source code?
thumbnail
Tejas Kanani,修改在10 年前。

RE: Redirect user to custome site after login

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Junior Member 帖子: 36 加入日期: 13-7-31 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login (答复)

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Junior Member 帖子: 36 加入日期: 13-7-31 最近的帖子
Thank Tejas,
It run fine now. Thank you so much!
thumbnail
Tejas Kanani,修改在10 年前。

RE: Redirect user to custome site after login

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
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,修改在9 年前。

RE: Redirect user to custome site after login

New Member 发布: 1 加入日期: 13-6-7 最近的帖子
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,修改在10 年前。

RE: Redirect user to custome site after login

Junior Member 帖子: 25 加入日期: 11-1-28 最近的帖子
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.