Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Rob Hall
Disable link for names in comments
September 24, 2012 12:35 PM
Answer

Rob Hall

Rank: Junior Member

Posts: 47

Join Date: November 30, 2011

Recent Posts

We are working with Liferay EE 6.1 GA1 and have comments enabled on various articles. However, when a user posts a comment to those articles, it attaches their picture (if available) and name in profile links that expose a security hole and gives the user access to the Control Panel and other Liferay features. Is there a configuration setting to disable the link (i.e. just show the commentor's name without a link to their profile) or can something be overwritten w/ a hook to accompllsh this?
Samuel Kong
RE: Disable link for names in comments
September 24, 2012 9:13 PM
Answer

Samuel Kong

LIFERAY STAFF

Rank: Liferay Master

Posts: 935

Join Date: March 10, 2008

Recent Posts

Yes, you should create a JSP hook. Specifically, you'll probably want to look into /html/taglib/ui/discussion/page.jsp
Rob Hall
RE: Disable link for names in comments
September 25, 2012 9:12 AM
Answer

Rob Hall

Rank: Junior Member

Posts: 47

Join Date: November 30, 2011

Recent Posts

That worked. I created a hook for page.jsp and replaced this

<liferay-ui:user-display
userId="<%= message.getUserId() %>"
userName="<%= HtmlUtil.escape(message.getUserName()) %>"
displayStyle="<%= 2 %>"
/>

with
<% String userName = message.getUserName(); %>
<b> <%= userName %> </b>
Mazhar Alam
RE: Disable link for names in comments
October 19, 2012 2:51 AM
Answer

Mazhar Alam

Rank: Regular Member

Posts: 188

Join Date: November 25, 2011

Recent Posts

Helpful post!!!