You are here

function bakery_user_view in Bakery Single Sign-On System 7.4

Same name and namespace in other branches
  1. 8.2 bakery.module \bakery_user_view()
  2. 7.2 bakery.module \bakery_user_view()

Implements hook_user_view().

File

./bakery.module, line 90

Code

function bakery_user_view($account, $view_mode, $langcode) {
  if (!variable_get('bakery_is_master', 0)) {
    $master = variable_get('bakery_master', 'https://drupal.org/');
    $init_url = _bakery_init_field_url($account->init);
    if (parse_url($master, PHP_URL_HOST) == parse_url($init_url, PHP_URL_HOST)) {
      $account->content['summary']['master_profile'] = array(
        '#type' => 'user_profile_item',
        '#title' => t('Primary profile'),
        '#markup' => l(t('Profile on primary site'), substr($init_url, 0, strlen($init_url) - 5)),
        // Take everything up to '/edit'.
        '#access' => user_access('access user profiles'),
      );
    }
  }
}