Fórum

redirect public page to private site

sasmita swain, modificado 10 Anos atrás.

redirect public page to private site

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
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
Olaf Kock, modificado 10 Anos atrás.

RE: redirect public page to private site

Liferay Legend Postagens: 6396 Data de Entrada: 23/09/08 Postagens Recentes
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
dave ch, modificado 10 Anos atrás.

RE: redirect public page to private site

Regular Member Postagens: 161 Data de Entrada: 07/02/12 Postagens Recentes
Hi Sasmita,
There is already available hook for Custom Landing Page in marketplace.

Thanks,
Dave
thumbnail
Vilmos Papp, modificado 10 Anos atrás.

RE: redirect public page to private site

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
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,>
sasmita swain, modificado 10 Anos atrás.

RE: redirect public page to private site

Regular Member Postagens: 183 Data de Entrada: 24/02/12 Postagens Recentes
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
mohan kumar, modificado 10 Anos atrás.

RE: redirect public page to private site

New Member Mensagem: 1 Data de Entrada: 10/05/13 Postagens Recentes
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
Tejas Kanani, modificado 10 Anos atrás.

RE: redirect public page to private site

Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
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
Roshan Qureshi, modificado 10 Anos atrás.

RE: redirect public page to private site

Regular Member Postagens: 159 Data de Entrada: 24/08/10 Postagens Recentes
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
Ugandhar Reddy, modificado 10 Anos atrás.

RE: redirect public page to private site

Junior Member Postagens: 25 Data de Entrada: 21/11/11 Postagens Recentes
you can go through the below link.

http://www.liferay.com/community/forums/-/message_boards/message/22731875
thumbnail
Krzysztof Gołębiowski, modificado 10 Anos atrás.

RE: redirect public page to private site

Liferay Master Postagens: 549 Data de Entrada: 25/06/11 Postagens Recentes
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
zeeshan aayan, modificado 10 Anos atrás.

RE: redirect public page to private site

New Member Postagens: 4 Data de Entrada: 03/09/13 Postagens Recentes
Thanks for sharing a great post