Fórumok

Login required for public paes

Arvind Gupta, módosítva 10 év-val korábban

Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
I have public pages and for some public pages login is required, due some constraint we do not want to create private pages. Can someone help me how can we achieve this.
thumbnail
David H Nebinger, módosítva 10 év-val korábban

RE: Login required for public paes

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
Go to the page permissions and remove guest access. Login will be required to view them as a result.
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Thanks David,I tried already tried this but in this case the page will not come in the navigation, is their any other way.
thumbnail
Milen Dyankov, módosítva 10 év-val korábban

RE: Login required for public paes

Expert Bejegyzések: 310 Csatlakozás dátuma: 2012.10.30. Legújabb bejegyzések
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Hi Milen I tried the solution but after login it is taking me to home page instead of the page that i clicked on. Is their any other way that we can achive this.
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Please help me in this
thumbnail
Milen Dyankov, módosítva 10 év-val korábban

RE: Login required for public paes

Expert Bejegyzések: 310 Csatlakozás dátuma: 2012.10.30. Legújabb bejegyzések
Check the value of auth.forward.by.last.path

    #
    # Set this to true if users are forwarded to the last visited path upon
    # successful login. If set to false, users will be forwarded to their
    # default layout page.
    #
    auth.forward.by.last.path=true
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Thanks millen it is now forwarding to page, but now my problem is i want to take the user to my custom login page in such case and in other cases to liferay default login page, I tried auth.login.site.url=/web/portal/login but it is giving me below error;

You do not have the roles required to access this portlet.

Can you please help me on this
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
can someone guide me on this i am stucked.
John Carter, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2012.10.18. Legújabb bejegyzések
Hi Arvind,
You can manage it through theme ,you can use init_custom.vm and redirect the user as per your requirement.
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Thanks for your reply John, I am new to liferay can give some example how to redirect from theme
John Carter, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2012.10.18. Legújabb bejegyzések
Hi Arvind,
You have done with forwarding part, that it will forward you to the page you want to show.And now you just want to redirect the user to your custom login page if he tried to access the page which need the authentication.For this flow I have created 2 pages noguest and guestlogin.
noguest page which will be available for the user after login and for login I have created custom page guestlogin and added the login portlet over it using theme. Now if you try to access my page (noguest) you will be redirected to the (guestlogin) page and after login ,it will take you the last path i.e. noguest page.

I have written the code in init_custom.vm.


#set($currentURL=$theme_display.getURLCurrent())
 #if(!$theme_display.isSignedIn())
   #if($currentURL.indexOf("/noguest") !=-1)
	  <script>window.location="$themeDisplay.getURLPortal()/guestLogin";</script>
   #end
 #end
Arvind Gupta, módosítva 10 év-val korábban

RE: Login required for public paes

Junior Member Bejegyzések: 29 Csatlakozás dátuma: 2012.12.18. Legújabb bejegyzések
Thanks John it worked for me