diff --git a/themes/openstack_bootstrap/template.php b/themes/openstack_bootstrap/template.php index efbf876..98e5c57 100755 --- a/themes/openstack_bootstrap/template.php +++ b/themes/openstack_bootstrap/template.php @@ -234,6 +234,7 @@ function openstack_bootstrap_preprocess_views_view(&$variables) { * Implements template_preprocess_user_profile() */ function openstack_bootstrap_preprocess_user_profile(&$variables) { + global $user; $account = $variables['elements']['#account']; if (in_array('ambassador', $account->roles)) { $variables['user_profile']['role_ambassador'] = array( @@ -249,8 +250,9 @@ function openstack_bootstrap_preprocess_user_profile(&$variables) { '#suffix' => '', ); } - if ((in_array('community_manager', $account->roles)) || - (in_array('ambassador', $account->roles))) { + if (((in_array('community_manager', $user->roles)) || + (in_array('ambassador', $user->roles)) || + (in_array('administrator', $user->roles))) && ($user->uid == $account->uid)) { $pending_groups = db_select('node', 'n') ->fields('n') ->condition('n.status', 0, '=') @@ -267,6 +269,12 @@ function openstack_bootstrap_preprocess_user_profile(&$variables) { '#prefix' => '

'.t('Groups waiting for approval').'

', '#markup' => $content, ); + $variables['user_profile']['reports'] = array( + '#prefix' => '

'.t('Reports').'

', + '#markup' => + '
'.l('User group membership report', 'reports/groups-membership-report').'
'. + '
'.l('Membership history report', 'reports/groups-membership-history-report').'
', + ); } if (user_is_logged_in()) { $variables['user_profile']['register_new_group'] = array( diff --git a/themes/openstack_bootstrap/templates/user-profile.tpl.php b/themes/openstack_bootstrap/templates/user-profile.tpl.php index 02bf8d4..a931628 100644 --- a/themes/openstack_bootstrap/templates/user-profile.tpl.php +++ b/themes/openstack_bootstrap/templates/user-profile.tpl.php @@ -46,6 +46,7 @@ + \ No newline at end of file