Based on several case studies of successful social networking sites internal to business, one of the cardinal rules has been to use people's real names to avoid the ability for someone to post without direct accountability. Therefore, I think it's important to have, either by default or by option, the use of real names in place of usernames except in the few places (such as edit profile) where the user name should strictly be displayed.

There are several ways to do this. It's been commonly done through the theme in many places, but I think putting it into the theme is a bad unless everyone is expected to subtheme off of commons, and in places where data is cached such as heartbeat, it presents challenges as to how to correct the display since it does not query the username on display of prior activity.

The realname module http://drupal.org/project/realname is a module with the aim to do this, and I have been very successful integrating it with other sites, so this has been my approach in Commons, and I have it running successfully. There is a thread at http://commons.acquia.com/wiki/real-names-drupal-commons that has instructions on setup and discussion about it.

CommentFileSizeAuthor
#5 realnames_feature.zip4.68 KBCrom

Comments

JBI’s picture

subscribing

Wolfflow’s picture

subscribing

mstef’s picture

Status: Active » Postponed
greggmarshall’s picture

subscribing

Crom’s picture

StatusFileSize
new4.68 KB

Following my post about outstanding issues to do with integrating realnames with DC, here: http://commons.acquia.com/wiki/real-names-drupal-commons#comment-19691

I've done some further work on trying to leverage realnames without changing DC core files (so that upgrading is still possible). I'm currently using DC 1.6 but am upgrading to 1.7 and will report any issues I find.

The below assumes that you have a sub-theme for your particular site (I have a sub-theme of commons_origins which is in itself a sub-theme of roots).

Please use the 1.x-dev version of realnames as 1.4 has an incompatibility with imagecache that will mean everyone's profile picture appears full size (see the realname issue queue for more details).

What I did was to create a realnames feature that takes care of the required settings (with the exception of the hearbeat rules that I need to change manually as features doesn't seem to 'like' over-writing-merging rules where there is already one of the same name present).

Then, within my custom theme folder I copied two templates across from commons_roots and added a function to my template.php. This is the template.php function and I've included the feature and 2 template files below.

Change the hook function name to your theme name:

function hook_user_relationships_request_relationship_direct_link($relate_to, $relationship_type) {
  //safety, revert to  a generic link
  if (!isset($relationship_type)) {
    return theme('user_relationships_request_relationship_link', $relate_to);
  }
  return l(
    t("Become %name's %rel_name", array('%name' => theme('username', $relate_to, array('plain' => TRUE)), '%rel_name' => ur_tt("user_relationships:rtid:$relationship_type->rtid:name", $relationship_type->name), '%rel_plural_name' => ur_tt("user_relationships:rtid:$relationship_type->rtid:plural_name", $relationship_type->plural_name))),
    "relationship/{$relate_to->uid}/request/{$relationship_type->rtid}",
    array(
      'query' => drupal_get_destination(),
      'html'  => TRUE,
      'attributes' => array('class' => 'user_relationships_popup_link'),
    )
  );
}

Any feedback will be gratefully received.
Cheers,
Crom

heather’s picture

Category: feature » support

The latest version of Commons with the "Commons profile" is great changed since the last post on this thread. Now there are fields in the user profile for firstname and lastname. I'm changing to a support request as I think it should be working, but isn't. I gave it a go recently and the RealNames module *almost* works.

It works OK on activity stream, and in author name of nodes.

Yet, on the "about" such as http://mycommons.com/user/3/about - the username is used. Something is wrong with this.

Looks like a conflict with the Commons profile module? I'm not sure the best way to manage it.

Only local images are allowed.

Does anyone have this working?

Any ideas on best way to fix this?

chules’s picture

I have been working on trying to replace username with real name on commons 2.3. I'm using the realname module with the latest development release.

Really simple objective and something that commons will need to address in order to compete with commercial products used for corporate intranets such as Jive and Sharepoint. You need to use real names and commons has extensive use of username without any way to systematically choose to use username or real name for all display. Username in an intranet case should be something hidden used for access only.

While the realname module definitely works and in my opinion should become core it does not address all the areas in commons where username is displayed. For example, I noticed all the thumbnails associated with members in blocks such as online, most active users, etc, when hovering over the image display the username instead of the realname even thought the link associated with the thumbnail is using the current link thanks to the realname module. The same is true with the profile block when viewing a user you see contact username. All of this I imagine needs to be addressed by somehow modifying the blocks. I am working on this now and if I find a solution I will post it.

Chules

ricks03’s picture

What I'm noticing is that, with realnames enabled, in some places it causes the thumbnail image to be replaced with the full uploaded image. The two places I see it most evidently are:
users/

in both the stream for the last activity posted, and the user profile image in the commons_profile block

Hope that helps.

ricks03’s picture

More testing, using the current dev version of realnames. when applied with unlimited_css (to resolve the IE 31 stylesheet problem) realnames breaks both the Comments Connect and Commons Origin themes. With realnames enabled, the information in the right sidebar appears at the bottom of the page instead, even after clearing the cache, in both IE AND firefox.

jsibley’s picture

Any progress?

jsibley’s picture

Version: » 6.x-2.4

I am also seeing the problem with full-sized user photos. Does anyone have a fix?

Andrea C’s picture

+1 to request RealName included in the standard Commons distribution.
Agree with chules in #7: in a intranet username should be hidden (I use also ldap_integration)
Most intranet also depend on Microsoft Active Directory and then on Internet Explorer so compatibility with the flag to solve the IE 31 css limit must be guaranteed

jsibley’s picture

Btw, for now I have addressed the oversized photo issue (I will trust it comes from realname but haven't confirmed this) by adding CSS in my local.css file to set the max-width for img. This is probably not specific enough, but gets the job done for now.

izkreny’s picture

@jsibley: AFAIK you need to use dev version of RealName module to solve oversized photo issue..

BTW, any plans to include RealName module into Commons 6.x core - more precisely to officially support global real names functionality?

This should be implemented as feature, right?

hankvanzile’s picture

Wouldn't the best approach be to set up Real Name to work with the Commons Profile module, as outlined here? http://drupal.org/node/329662

greggles’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
Component: User interface » Code
Category: support » feature
Status: Postponed » Active

Yeah, this is a feature request that should be Active.

To be honest, I'm not sure if the right answer is to rely on real names or just do a lighterweight version of that in commons itself. It would be great if someone could evaluate those options and propose one architecture and provide any code patches to get it done.

If there are instances of commons outputting the username without making a call to theme('username') then those are bugs and could be fixed as part of this issue or other issues.

Thanks to everyone who has provided ideas and feedback in this thread!

jsibley’s picture

Why not use the existing module? It already seems to be working, for the most part.

Once I added some CSS to fix the photo size issue, I haven't noticed any problems with the existing modules.

greggles’s picture

Title: Add Real Names to Drupal Commons » Add Real Names support to Drupal Commons

@jsibley Yeah, I think that's an option, but it's worth exploring. It's probably more about figuring out why those images look crazy and fixing them (though I think that might have been a different and already fixed issue).

I don't know that Real names needs to be in Commons itself, but it should be possible to add it without having things go wonky - hence changing the title.

hankvanzile’s picture

Using the current dev copy of Real Names and Commons 6.x.2.4, I've had only a little bit of trouble. The primary context in which it fell apart for me is when viewing another user's profile. The action links ("Contact username," "Edit username's profile") I was able to override in a custom module; however, I'm still stuck with the "User's Groups" block. Commons or OG is dynamically overwriting the block title to be "Username's Groups" and I haven't yet figure out where to fix that.

The "Browse Users" view needs a bit of love, as well, but I haven't spent a lot of time on that just yet.

Roger34’s picture

I tried both recommended version and development versions (latest) of realname module, yet username is used in "About" view in Profile. So are logs in activity stream. Is there any way to fix this?

Bryan Cordrey’s picture

I am experiencing the same issue as above. Has there been any progress on a patch?

Roger34’s picture

Not so far! Welcome to the club.

hankvanzile’s picture

Hi guys,

I solved the about page issue by editing the view for the About page: profile_about_page. Under Argument, you need to click on "User: Uid". When the configuration options are loaded, scroll down to the "Validator Options" section and change the validator to "User (realname)".

It's been a while since I set this up, but I'm pretty sure that's all it took. If that doesn't work for you, let me know and I'll try to figure out what I missed.

Roger34’s picture

RightSizedView: Your method displays as "Anonymous". Does not display first and last name as given in realname configuration.

ezra-g’s picture

Status: Active » Closed (duplicate)