掲示板

Redirect user to custome site after login

10年前 に Jason Dobyns によって更新されました。

Redirect user to custome site after login

Junior Member 投稿: 36 参加年月日: 13/07/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.
10年前 に venka reddy によって更新されました。

RE: Redirect user to custome site after login

Regular Member 投稿: 231 参加年月日: 11/03/23 最新の投稿
Hi,

Below link can be useful

http://liferaytutorial.blogspot.in/2013/11/redirecting-user-default-landing-page.html
thumbnail
10年前 に Pankaj Kathiriya によって更新されました。

RE: Redirect user to custome site after login

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
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.
10年前 に Jason Dobyns によって更新されました。

RE: Redirect user to custome site after login

Junior Member 投稿: 36 参加年月日: 13/07/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
10年前 に Pankaj Kathiriya によって更新されました。

RE: Redirect user to custome site after login

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
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.
10年前 に Jason Dobyns によって更新されました。

RE: Redirect user to custome site after login

Junior Member 投稿: 36 参加年月日: 13/07/31 最新の投稿
Do we have to create this class "com.xxx.CustomLandingPageAction", if yes, can you give me an snippets source code?
thumbnail
10年前 に Tejas Kanani によって更新されました。

RE: Redirect user to custome site after login

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
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
10年前 に Jason Dobyns によって更新されました。

RE: Redirect user to custome site after login

Junior Member 投稿: 36 参加年月日: 13/07/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
10年前 に Tejas Kanani によって更新されました。

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

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
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
10年前 に Jason Dobyns によって更新されました。

RE: Redirect user to custome site after login

Junior Member 投稿: 36 参加年月日: 13/07/31 最新の投稿
Thank Tejas,
It run fine now. Thank you so much!
thumbnail
10年前 に Tejas Kanani によって更新されました。

RE: Redirect user to custome site after login

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
It run fine now. Thank you so much!

Glad to hear that !! emoticon

Thanks,
Tejas Kanani
Sr. Consultant @ CIGNEX Datamatics
http://www.opensourceforlife.com
9年前 に Moha obarm によって更新されました。

RE: Redirect user to custome site after login

New Member 投稿: 1 参加年月日: 13/06/07 最新の投稿
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
10年前 に Joseph Toman によって更新されました。

RE: Redirect user to custome site after login

Junior Member 投稿: 25 参加年月日: 11/01/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.