Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Krisztián Schaffer
Hide the real name of the user in the forum
September 12, 2009 10:10 AM
Answer

Krisztián Schaffer

Rank: New Member

Posts: 3

Join Date: September 12, 2009

Recent Posts

Hi,

We are using Liferay 5.2 for our new site for 3 weeks with success. Today I received from one of our users the following: "PROTIP: Displaying forum users' real names by default, without any option otherwise is a terrible internet forum faux-pas."

Altough I didn't noticed this previously, now I think it is true. Especially because our site is for a subculture with strong forum tradition and they accustomed to use nicknames.

I am unable to find any configuration option related to that issue. Displaying the screen name without any option to the user would be great for me.


Thanks in advance,
Krisztián
Wilson Man
RE: Hide the real name of the user in the forum
September 12, 2009 2:42 PM
Answer

Wilson Man

LIFERAY STAFF

Rank: Liferay Master

Posts: 577

Join Date: June 21, 2006

Recent Posts

yeah, i don't think it's a configurable option currently. you'd have to modify the JSP in the EXT environment if you want to try the modification yourself.

However, you should definitely enter the feature request here if it's not already there (follow the link in this thread to the wiki): http://www.liferay.com/web/guest/community/forums/-/message_boards/message/4006725
Krisztián Schaffer
RE: Hide the real name of the user in the forum
September 13, 2009 12:08 PM
Answer

Krisztián Schaffer

Rank: New Member

Posts: 3

Join Date: September 12, 2009

Recent Posts

Thank you, I have added the request to the wiki!
Krisztián Schaffer
RE: Hide the real name of the user in the forum
October 21, 2009 1:27 AM
Answer

Krisztián Schaffer

Rank: New Member

Posts: 3

Join Date: September 12, 2009

Recent Posts

I see that there is hard work on the solution of privacy problems, but I have no more time so I have created a quickfix.

I am not a Liferay developer, the solution may not the cleanest one, but it seems to work for me.

In PortalImpl.java there is a way to change the default name of the user from the full name to the screen name, but the problem is that some portlets, e.g. the activities and the message boards uses direct getFullName() calls, so changing the default name to screen name solves the problem on some places of the portal, but not on other places.

So I modified the UserImpl class in order to change the full name from the form of 'first name middle name last name' to 'screen name'

Steps to reproduce the fix:

  • Donwload the source from sourceforge
  • Edit the file portal-impl/src/com/liferay/portal/model/impl/UserImpl.java and change the method getFullName:

     1*** ./portal-impl/src/com/liferay/portal/model/impl/UserImpl.java       Wed Oct 21 10:16:00 2009
     2--- ./portal-impl/src/com/liferay/portal/model/impl/UserImpl.java.orig  Wed Oct 21 10:16:40 2009
     3***************
     4*** 150,156 ****
     5        }
     6 
     7        public String getFullName() {
     8!               return getScreenName();
     9        }
    10 
    11        public Group getGroup() {
    12--- 150,157 ----
    13        }
    14 
    15        public String getFullName() {
    16!               return ContactConstants.getFullName(
    17!                       getFirstName(), getMiddleName(), getLastName());
    18        }
    19 
    20        public Group getGroup() {
  • Build the portal with calling ant
  • move the file portal-impl/classes/com/liferay/portal/model/impl/UserImpl.class to your application server's WEB-INF/classes//com/liferay/portal/model/impl/ directory. You need to create the subdirectories starting from 'com'
  • Restart the appserver


You can find the portal running with this mod under http://battletac.com/web/guest/forum.

Thanks for the Liferay team for the great product!