Skip to content

Commit

Permalink
changing sympa to email list, adding support for secret optin/optout
Browse files Browse the repository at this point in the history
  • Loading branch information
axel committed Aug 20, 2021
1 parent 1be5bb3 commit c332d71
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
31 changes: 23 additions & 8 deletions Lib/GrouperApiAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,15 +303,30 @@ private function useMembershipUrl(array $queryData) {
throw new GrouperLiteException("Option of $groupType is not supported");
}

//Build request logic
$groupsToShow = array(
"WsRestGetMembershipsRequest" => array(
"fieldName" => $fieldName,
"wsSubjectLookups" => array(
array("subjectId" => $subjectId)
if ($groupType == 'Optins' || $groupType == 'Optouts') {
//Build request logic, 2 subjectId's, second is for when user in "Secret" Optin/Optout Group
$groupsToShow = array(
"WsRestGetMembershipsRequest" => array(
"fieldName" => $fieldName,
"wsSubjectLookups" => array(
array("subjectId" => $subjectId),
array("subjectId" => $userId)
)
)
)
);
);
} else {
//Build request logic
$groupsToShow = array(
"WsRestGetMembershipsRequest" => array(
"fieldName" => $fieldName,
"wsSubjectLookups" => array(
array("subjectId" => $subjectId)
)
)
);
}


$this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json'));
$connectionUrl = "{$this->config['fullUrl']}/memberships";

Expand Down
2 changes: 1 addition & 1 deletion Lib/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
'pl.grouperlite.value.enabled' => 'Enabled',
'pl.grouperlite.value.disabled' => 'Disabled',

'pl.grouperlite.value.sympa - internet2' => 'A collection of email addresses to be used by the members of the group for communication purposes.',
'pl.grouperlite.value.email' => 'Email address of Working Group List',
'pl.grouperlite.value.jira' => 'For this Group, Jira provides a place to plan, track, and manage your agile and software development projects.',
'pl.grouperlite.value.confluence' => 'The Confluence group is a team workspace, specifically for this Group, where knowledge and collaboration meet allowing for the ability to Create, collaborate, and organize content in one place.',
'pl.grouperlite.value.incommon-collab' => '',
Expand Down
9 changes: 9 additions & 0 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ private function getFriendlyWorkingGroupName(array $groups) {
}
$appCount += 1;
}
//changed the way email list are displayed to actually show lists email address.
if ($appName == 'sympa - internet2' || $appName == 'sympa - incommon'){
if ($appName == 'sympa - internet2'){
$appName = $group['WGName'] . '@lists.' . 'internet2.edu';
} else {
$appName = $group['WGName'] . '@lists.' . 'incommon.org';
}

}
$group['WGApp'] = $appName;
//TODO - FOR DEMO PURPOSE THAT LEAVES OUT ADMIN GROUPS TO SHOW WHAT AVERAGE USER SEES
if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owners') {
Expand Down
10 changes: 7 additions & 3 deletions View/GrouperGroups/groupmember.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ $numColumns = count($columns);
) ?>" title="<?php echo $group['name']; ?>">
<?php echo $group['WGApp'] ?? "No Name"; ?></a>
</td>
<?php if ($isuserowner === 'T') { ?>
<?php if ($isuserowner === 'T') : ?>
<td><?php echo $group['WGRole'] ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php } ?>
<td><?php echo _txt('pl.grouperlite.value.'.$group['WGApp'] ) ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php endif; ?>
<?php if (strpos($group['WGApp'], '@lists') !== false) : ?>
<td><?php echo _txt('pl.grouperlite.value.email' ); ?></td>
<?php else: ?>
<td><?php echo _txt('pl.grouperlite.value.'.$group['WGApp'] ) ?? _txt('pl.grouperlite.value.descr.zerostate'); ?></td>
<?php endif; ?>
<td>

</td>
Expand Down

0 comments on commit c332d71

Please sign in to comment.