Fórumok

redirect public page to private site

sasmita swain, módosítva 11 év-val korábban

redirect public page to private site

Regular Member Bejegyzések: 183 Csatlakozás dátuma: 2012.02.24. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: redirect public page to private site

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: redirect public page to private site

Regular Member Bejegyzések: 161 Csatlakozás dátuma: 2012.02.07. Legújabb bejegyzések
Hi Sasmita,
There is already available hook for Custom Landing Page in marketplace.

Thanks,
Dave
thumbnail
Vilmos Papp, módosítva 11 év-val korábban

RE: redirect public page to private site

Liferay Master Bejegyzések: 529 Csatlakozás dátuma: 2010.10.21. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: redirect public page to private site

Regular Member Bejegyzések: 183 Csatlakozás dátuma: 2012.02.24. Legújabb bejegyzések
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, módosítva 10 év-val korábban

RE: redirect public page to private site

New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.05.10. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: redirect public page to private site

Liferay Master Bejegyzések: 654 Csatlakozás dátuma: 2009.01.06. Legújabb bejegyzések
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, módosítva 11 év-val korábban

RE: redirect public page to private site

Regular Member Bejegyzések: 159 Csatlakozás dátuma: 2010.08.24. Legújabb bejegyzések
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, módosítva 10 év-val korábban

RE: redirect public page to private site

Junior Member Bejegyzések: 25 Csatlakozás dátuma: 2011.11.21. Legújabb bejegyzések
you can go through the below link.

http://www.liferay.com/community/forums/-/message_boards/message/22731875
thumbnail
Krzysztof Gołębiowski, módosítva 10 év-val korábban

RE: redirect public page to private site

Liferay Master Bejegyzések: 549 Csatlakozás dátuma: 2011.06.25. Legújabb bejegyzések
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, módosítva 10 év-val korábban

RE: redirect public page to private site

New Member Bejegyzések: 4 Csatlakozás dátuma: 2013.09.03. Legújabb bejegyzések
Thanks for sharing a great post