Fórumok

Disable link for names in comments

Rob Hall, módosítva 11 év-val korábban

Disable link for names in comments

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2011.11.30. Legújabb bejegyzések
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?
thumbnail
Samuel Kong, módosítva 11 év-val korábban

RE: Disable link for names in comments

Liferay Legend Bejegyzések: 1902 Csatlakozás dátuma: 2008.03.10. Legújabb bejegyzések
Yes, you should create a JSP hook. Specifically, you'll probably want to look into /html/taglib/ui/discussion/page.jsp
Rob Hall, módosítva 11 év-val korábban

RE: Disable link for names in comments

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2011.11.30. Legújabb bejegyzések
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>
thumbnail
Mazhar Alam, módosítva 11 év-val korábban

RE: Disable link for names in comments

Regular Member Bejegyzések: 191 Csatlakozás dátuma: 2011.11.25. Legújabb bejegyzések
Helpful post!!!