You are here

function redhen_contact_username_alter in RedHen CRM 7

Implements hook_username_alter().

File

modules/redhen_contact/redhen_contact.module, line 1114
Module file for RedHen contacts.

Code

function redhen_contact_username_alter(&$name, $account) {
  if ($account && variable_get(REDHEN_CONTACT_ALTER_USERNAME, FALSE)) {
    $contact = redhen_contact_load_by_user($account);

    // Display the contact label if the user is linked to a contact.
    if ($contact) {
      $name = $contact
        ->label();
    }
  }
}