Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
padmalaya pradhani
How to re-design the login portlet with an image ?
April 9, 2012 3:44 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Hi All,

Please advise me to re-use the sign in portlet which has the look and feel as below


Thanks in advance.
Attachment

Attachments: login.JPG (18.1k)
Bart Simpson
RE: How to re-design the login portlet with an image ?
April 9, 2012 3:59 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Add a web content display and design the image part in it. Add Login portlet and design the rest.
In case all the requirements don't match then : Hook login.jsp
Ravi Kumar Gupta
RE: How to re-design the login portlet with an image ?
April 9, 2012 4:07 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1303

Join Date: June 23, 2009

Recent Posts

You can create a jsp hook for this login portlet and place the image in either theme/some place where it can be accessed and use in jsp.
HTH
-Ravi
padmalaya pradhani
RE: How to re-design the login portlet with an image ?
April 10, 2012 12:10 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Thanks Ravi and paul. Implementing the above using hooks worked, but the path of the image using img tag is not getting rendered.

I have another issue , I want the sign in portlet to appear in the landing page , and one successful login, it wud get redirected to the Home page .. which is invisible to the guest user.

How can I achieve the same?


Thanks in advance

Padmalaya
Bart Simpson
RE: How to re-design the login portlet with an image ?
April 10, 2012 12:45 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

Go to Control - > Portal - >Portal Settings

There is a field present called 'Default Landing Page' (This is the page that users are automatically redirected to after logging in. For example, if you want the default landing page to be http://localhost:8080/web/guest/login, then set this to /web/guest/login.)

specify the page where you want the users to be redirected after login.
padmalaya pradhani
RE: How to re-design the login portlet with an image ?
April 10, 2012 12:54 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Hi All,

I got the image in the hook using <img src="<%=request.getContextPath()%>image/image_gallery?uuid=500aae2f-be1" />

However , getting it redirected to a new page after login is not yet achieved.

Please help

Padmalaya
padmalaya pradhani
RE: How to re-design the login portlet with an image ?
April 10, 2012 1:22 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Hi All,

Let me describe it using this image.. before login .. it should appear as below



I can get it redirected to the home page.. but tab 1 containing the sign in portlet should disapper and should not be viewed by the logged in users.



How to achieve the same?

Please advice.

Regards,

Padmalaya
Anil Sunkari
RE: How to re-design the login portlet with an image ?
April 10, 2012 1:39 AM
Answer

Anil Sunkari

Rank: Expert

Posts: 427

Join Date: August 11, 2009

Recent Posts

Hi Pradhani,

For not making login portlet visible:
1) If it not your custom login portlet.So, you can delete from that page.
2) For redirection to particular page you can check for properties mentioned in portal.properties file.

For Example :

#
# Enter a URL that will be used to login portal users whenever needed. By
# default, the portal's login page is used.
#
#auth.login.url=/web/guest/home

#
# Enter a friendly URL of a page that will be used to login portal users
# whenever the user is navigating a community and authentication is needed.
# By default, the portal's login page or the URL set in the property
# "auth.login.url" is used.
#
auth.login.community.url=/login

Maybe if i'm correct the above suggestion will be helpful to you!

Regards,
Anil S
padmalaya pradhani
RE: How to re-design the login portlet with an image ?
April 10, 2012 3:53 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Hi Anil,

I think you have misinterpreted my query.

I want the sign-in portlet in the Welcome page to disaaper after login... that is once u have logged in , u shud be able to view the Home page (U can relate it to a simple form on submit getting redirected to a new Page altogether.)

For not making login portlet visible:
1) If it not your custom login portlet.So, you can delete from that page.


If I delete the page... users wont be able to login... this page contains the login portlet...


2) For redirection to particular page you can check for properties mentioned in portal.properties file.


I can redirect it to my default landing page. The only issue is I want to diable view of the sign in page to logged in users.

Regards

Padmalaya
Anil Sunkari
RE: How to re-design the login portlet with an image ?
April 12, 2012 11:58 PM
Answer

Anil Sunkari

Rank: Expert

Posts: 427

Join Date: August 11, 2009

Recent Posts

so, here you can make it through permission through built-in roles if not your custom role.
Hitoshi Ozawa
RE: How to re-design the login portlet with an image ?
April 14, 2012 6:16 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

All roles are assigned Guest privileges so logged in users will be able to view the portelt. You'll have to modify the login portlet to check for user's roles and hide it if other than Guest.
padmalaya pradhani
RE: How to re-design the login portlet with an image ?
April 25, 2012 2:50 AM
Answer

padmalaya pradhani

Rank: New Member

Posts: 10

Join Date: March 15, 2012

Recent Posts

Hi Hitoshi,

Do I need to make changes in the login hook?? and check if the logged in user is not a guest.

I think I still need to know the approach to hide the page from logged in users.

Thanks in advance

Padmalaya
Ravi Kumar Gupta
RE: How to re-design the login portlet with an image ?
April 25, 2012 3:26 AM
Answer

Ravi Kumar Gupta

Rank: Liferay Legend

Posts: 1303

Join Date: June 23, 2009

Recent Posts

What Hithoshi meant is, whenever a user comes on page, if he is logged in he will be getting permissions associated with all roles assigned to him along with Guest role. A Guest user is nothing but any visitor until login. And you need to check for the roles in login portlet and see if user has already logged in. If yes then hide otherwise show.
"A logged in user is never a Guest but holds all permissions assigned to guest also"

Check this post and see if it helps you. https://www.liferay.com/community/forums/-/message_boards/message/3476580