Added overview of groups a user is a member of

This commit is contained in:
Roeland Jago Douma 2015-02-04 20:32:41 +01:00
parent 2c899f1d43
commit 7a8f95be2f
2 changed files with 14 additions and 0 deletions

View file

@ -100,6 +100,12 @@ $tmpl->assign('enableAvatars', $config->getSystemValue('enable_avatars', true));
$tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser())); $tmpl->assign('avatarChangeSupported', OC_User::canUserChangeAvatar(OC_User::getUser()));
$tmpl->assign('certs', $certificateManager->listCertificates()); $tmpl->assign('certs', $certificateManager->listCertificates());
// Get array of group ids for this user
$groups = \OC::$server->getGroupManager()->getUserIdGroups(OC_User::getUser());
$groups2 = array_map(function($group) { return $group->getGID(); }, $groups);
sort($groups2);
$tmpl->assign('groups', $groups2);
// add hardcoded forms from the template // add hardcoded forms from the template
$l = OC_L10N::get('settings'); $l = OC_L10N::get('settings');
$formsAndMore = array(); $formsAndMore = array();

View file

@ -136,6 +136,14 @@ if($_['passwordChangeSupported']) {
} }
?> ?>
<div id="groups" class="section">
<h2><?php p($l->t('Groups')); ?></h2>
<p><?php p($l->t('You are member of the following groups:')); ?></p>
<p>
<?php p(implode(', ', $_['groups'])); ?>
</p>
</div>
<?php if ($_['enableAvatars']): ?> <?php if ($_['enableAvatars']): ?>
<form id="avatar" class="section" method="post" action="<?php p(\OC_Helper::linkToRoute('core_avatar_post')); ?>"> <form id="avatar" class="section" method="post" action="<?php p(\OC_Helper::linkToRoute('core_avatar_post')); ?>">
<h2><?php p($l->t('Profile picture')); ?></h2> <h2><?php p($l->t('Profile picture')); ?></h2>