function bakery_user_view in Bakery Single Sign-On System 7.2
Same name and namespace in other branches
- 8.2 bakery.module \bakery_user_view()
- 7.4 bakery.module \bakery_user_view()
Implements hook_user_view().
File
- ./
bakery.module, line 223 - Module file for the Bakery.
Code
function bakery_user_view($account, $view_mode, $langcode) {
if (!variable_get('bakery_is_master', 0)) {
$master = variable_get('bakery_master', 'http://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['bakery_primary_profile'] = array(
// Take everything up to '/edit'.
'#markup' => l(t('Profile on primary site'), substr($init_url, 0, strlen($init_url) - 5)),
'#access' => user_access('access user profiles'),
);
}
}
}