掲示板

redirect public page to private site

11年前 に sasmita swain によって更新されました。

redirect public page to private site

Regular Member 投稿: 183 参加年月日: 12/02/24 最新の投稿
Hi

I am working on LR6.1 ga2..i have one login page and it is in public page.i have one more private site like http://localhost:8080/web/group/faulty..i want when i am login after submit it will redirect to private site.

how to do?

Thanks
Sasmita
thumbnail
11年前 に Olaf Kock によって更新されました。

RE: redirect public page to private site

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
You'll have to configure the Default Landing Page. Googling this expression gives a lot of hints on how to override the default if you want it done programmatically

P.S. You'll probably get more/better answers if you post english questions to an english forum instead of a german language one.
thumbnail
11年前 に dave ch によって更新されました。

RE: redirect public page to private site

Regular Member 投稿: 161 参加年月日: 12/02/07 最新の投稿
Hi Sasmita,
There is already available hook for Custom Landing Page in marketplace.

Thanks,
Dave
thumbnail
11年前 に Vilmos Papp によって更新されました。

RE: redirect public page to private site

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
You can override the default DefaultLandingPageAction class and implement your business logic there:

protected void doRun(
			HttpServletRequest request, HttpServletResponse response)
		throws Exception {

		long companyId = PortalUtil.getCompanyId(request);

		String path = PrefsPropsUtil.getString(
			companyId, PropsKeys.DEFAULT_LANDING_PAGE_PATH);

		if (_log.isInfoEnabled()) {
			_log.info(
				PropsKeys.DEFAULT_LANDING_PAGE_PATH + StringPool.EQUAL + path);
		}

		if (Validator.isNotNull(path)) {
			LastPath lastPath = new LastPath(StringPool.BLANK, path);

			HttpSession session = request.getSession();

			session.setAttribute(WebKeys.LAST_PATH, lastPath);
		}

		// The commented code shows how you can programmaticaly set the user's
		// landing page. You can modify this class to utilize a custom algorithm
		// for forwarding a user to his landing page. See the references to this
		// class in portal.properties.

		/*Map<string, string[]> params = new HashMap<string, string[]>();

		params.put("p_l_id", new String[] {"1806"});

		LastPath lastPath = new LastPath("/c", "/portal/layout", params);

		session.setAttribute(WebKeys.LAST_PATH, lastPath);*/
	}</string,></string,>
11年前 に sasmita swain によって更新されました。

RE: redirect public page to private site

Regular Member 投稿: 183 参加年月日: 12/02/24 最新の投稿
Thanks for your reply
my code is:
@Override
public void run(HttpServletRequest request, HttpServletResponse response)
throws ActionException {


try {
HttpSession ses = request.getSession();

// To manually set a path for the user to forward to, edit
// portal.properties and set auth.forward.by.last.path to true.

Map params = new HashMap();

//params.put("p_l_id", new String[] {"PRI.3.1"});
params.put("p_l_id", new String[] {"PUB.1.1"});

LastPath lastPath = new LastPath("/c", "http://localhost:8080/group/guest/faculty", params);


ses.setAttribute(WebKeys.LAST_PATH, lastPath);
}
catch (Exception e) {
throw new ActionException(e);
}
when i am login by test test it is redirecting to localhost:web/faculty.. and it is showing not found this url.

can you tell me where i am doing wrong??

Thanks
Sasmita
10年前 に mohan kumar によって更新されました。

RE: redirect public page to private site

New Member 投稿: 1 参加年月日: 13/05/10 最新の投稿
Hi Vilmos Papp,
I am very new liferay .so please help me where i replace this method and
how to create new portal for custom login to logou page ?
how to deploy that that application?
Advanced thanks for help
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: redirect public page to private site

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Hi Sasmita,

If you have common landing page for all the user to be redirected after login, you can set it from Control Panel itself.
Just go to Control Panel -> Portal -> Portal Settings -> Default Landing Page. Set value as "/web/group/faulty" in text box & save.

This will redirect each user to /web/group/faulty page after login. It doesn't matter which is you login page, so you could set any page as login page.

In case if you have any complex requirement like user should redirect to his/her public/private page or his/her site's/org's public/private page of which they are member off, then I would suggest to go with CustomLandingPage. Either you can code as per you requirement or you can also go with CustomLandingPageHook already available in Liferay Marketplace which does similar job for you without any coding effort is required.

I hope this will be helpful.

And also agree with Olaf, Please use English forum.

Thanks,
Tejas
11年前 に Roshan Qureshi によって更新されました。

RE: redirect public page to private site

Regular Member 投稿: 159 参加年月日: 10/08/24 最新の投稿
Hi Sasmita,

By setting following properties you can do this.

default.landing.page.path=/web/group/faulty
auth.forward.by.last.path=true

But the user must be community member and have access to this page as a community member.

I hope this will work for you.

Thanks,
Roshan Qureshi
10年前 に Ugandhar Reddy によって更新されました。

RE: redirect public page to private site

Junior Member 投稿: 25 参加年月日: 11/11/21 最新の投稿
you can go through the below link.

http://www.liferay.com/community/forums/-/message_boards/message/22731875
thumbnail
10年前 に Krzysztof Gołębiowski によって更新されました。

RE: redirect public page to private site

Liferay Master 投稿: 549 参加年月日: 11/06/25 最新の投稿
I have the same configuration at one of our customer portals. I configured it using Liferay Virtual Hosts.

You have to:
  • Set virtual host domain name for your private pages (eq. private.example.com) and leave public pages blank
  • Create single public page containing login portlet
  • Add private pages as you wish


After entering private.example.com Liferay will display public login page first, and after logging in user will be automatically redirected to site private pages (according to virtual host configuration).

Regards,
KG
10年前 に zeeshan aayan によって更新されました。

RE: redirect public page to private site

New Member 投稿: 4 参加年月日: 13/09/03 最新の投稿
Thanks for sharing a great post