From af0d470462839a4b3c0ff177b0e5eab7a3fae280 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 22 Mar 2021 13:46:41 -0700 Subject: [PATCH 001/143] Fixed accessibility issues --- Lib/lang.php | 4 ++ View/CoGrouperLites/display.ctp | 4 +- View/Elements/Components/groupattributes.ctp | 5 +- View/Elements/Components/search.ctp | 1 + View/Elements/base-styles.ctp | 2 +- View/Elements/pagination.ctp | 2 +- View/GrouperGroups/emaillistsmanage.ctp | 8 ++- View/GrouperGroups/emaillistsmember.ctp | 24 +++++--- View/GrouperGroups/emaillistsoptin.ctp | 8 ++- View/GrouperGroups/groupfields.inc | 4 +- View/GrouperGroups/groupmember.ctp | 20 +++---- View/GrouperGroups/groupoptin.ctp | 20 +++---- View/GrouperGroups/groupowner.ctp | 20 +++---- View/GrouperGroups/templatefields.inc | 63 ++++++++------------ 14 files changed, 88 insertions(+), 97 deletions(-) diff --git a/Lib/lang.php b/Lib/lang.php index 80f2baf..cecac6e 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -20,6 +20,9 @@ 'pl.grouperlite.nav.emaillists' => 'Email Lists', 'pl.grouperlite.nav.groups' => 'Groups', + 'pl.grouperlite.dashboard.heading.groups' => 'Groups', + 'pl.grouperlite.dashboard.heading.email-lists' => 'Email lists', + 'pl.grouperlite.title.root' => 'Grouper Collaborations:', 'pl.grouperlite.title.groupinfo' => 'Group configuration and attributes', 'pl.grouperlite.title.groupowner' => 'Groups I manage', @@ -120,6 +123,7 @@ 'pl.grouperlite.form.template.value.internet2' => 'Internet2', 'pl.grouperlite.form.template.value.incommon' => 'Incommon', 'pl.grouperlite.form.template.is-optin.label' => 'Is optin?', + 'pl.grouperlite.form.template.is-moderated.label' => 'Is moderated?', 'pl.grouperlite.form.template.add-wiki.label' => 'Add wiki?', 'pl.grouperlite.form.template.add-project.label' => 'Add project?', 'pl.grouperlite.form.template.value.positive' => 'Yes', diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index 6d1e03e..3a56e7f 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -48,7 +48,7 @@ echo $this->element('GrouperLite.base-styles');
-
  Groups
+
 
-
  Email Lists
+
 
@@ -20,8 +21,8 @@ - +
-

+

\ No newline at end of file diff --git a/View/Elements/Components/search.ctp b/View/Elements/Components/search.ctp index ca42a44..37c1491 100644 --- a/View/Elements/Components/search.ctp +++ b/View/Elements/Components/search.ctp @@ -21,6 +21,7 @@ )); ?>
+ \ No newline at end of file diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index b972042..cea9b3b 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -10,7 +10,7 @@ 'counter' => true, 'class' => 'counter' )); ?> - +
@@ -39,17 +39,11 @@ - - - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
+ element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?>
\ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 593b2b3..33463c5 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -10,7 +10,7 @@ 'counter' => true, 'class' => 'counter' )); ?> - +
@@ -46,17 +46,11 @@ - - - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
+ element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?>
\ No newline at end of file diff --git a/View/GrouperGroups/templatefields.inc b/View/GrouperGroups/templatefields.inc index 47b7d85..c01d6f0 100644 --- a/View/GrouperGroups/templatefields.inc +++ b/View/GrouperGroups/templatefields.inc @@ -42,16 +42,13 @@ )); ?>
-
- Form->label(false, _txt('pl.grouperlite.form.template.enable-email-list.label'), array( - 'for' => 'gsh_input_isSympa', - 'class' => "col-sm-3 col-form-label" - )); ?> +
+
Form->input( 'gsh_input_isSympa', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isSympa', @@ -67,14 +64,14 @@ ) ); ?>
-
-
- + +
+
Form->input( 'gsh_input_sympaDomain', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_sympaDomain', @@ -89,17 +86,14 @@ ) ); ?>
-
-
- Form->label(false, "Is moderated?", array( - 'for' => 'gsh_input_isSympaModerated', - 'class' => "col-sm-3 col-form-label" - )); ?> + +
+
Form->input( 'gsh_input_isSympaModerated', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isSympaModerated', @@ -115,17 +109,14 @@ ) ); ?>
-
-
- Form->label(false, _txt('pl.grouperlite.form.template.is-optin.label'), array( - 'for' => 'gsh_input_isOptin', - 'class' => "col-sm-3 col-form-label" - )); ?> + +
+
Form->input( 'gsh_input_isOptin', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isOptin', @@ -141,7 +132,7 @@ ) ); ?>
-
+ -
- Form->label(false, _txt('pl.grouperlite.form.template.add-wiki.label'), array( - 'for' => 'gsh_input_isConfluence', - 'class' => "col-sm-3 col-form-label" - )); ?> +
+
Form->input( 'gsh_input_isConfluence', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isConfluence', @@ -184,17 +172,14 @@ ) ); ?>
-
-
- Form->label(false, _txt('pl.grouperlite.form.template.add-project.label'), array( - 'for' => 'gsh_input_isJira', - 'class' => "col-sm-3 col-form-label" - )); ?> + +
+
Form->input( 'gsh_input_isJira', array( - 'label' => false, + 'label' => true, 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isJira', @@ -210,7 +195,7 @@ ) ); ?>
-
+
Form->button(_txt('pl.grouperlite.form.group.action.save'), array( From 7b26c048ffc6b53f16b6e3580743c71305222106 Mon Sep 17 00:00:00 2001 From: axman Date: Sun, 28 Mar 2021 18:30:42 -0700 Subject: [PATCH 002/143] updated for I2 Dev enviro --- Controller/GrouperGroupsController.php | 22 +++++++++++++++------- Lib/GrouperApiAccess.php | 11 ++++------- Model/GrouperGroup.php | 18 ++++++++++++++++++ 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 69fc296..97af3e0 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -180,8 +180,8 @@ public function groupOwner() { //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => ($this->passedArgs['page'] ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => ($this->passedArgs['limit'] ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), + 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), ]; if (isset($this->request->data['search'])) { @@ -235,8 +235,8 @@ public function groupMember() { //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => ($this->passedArgs['page'] ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => ($this->passedArgs['limit'] ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), + 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), ]; if (isset($this->request->data['search'])) { @@ -463,9 +463,17 @@ public function leaveGroup() { function isAuthorized() { $roles = $this->Role->calculateCMRoles(); - //Need to pull in UserID for access to Grouper + //This call just pulls in user ID from comanage but not Grouper, need the Grouper Id for API calls. + /* if ($this->Session->check('Auth.User.username')) { $this->userId = $this->Session->read('Auth.User.username'); + }*/ + + if ($this->Session->check('Plugin.Grouper.UserId')) { + $this->userId = $this->Session->read('Plugin.Grouper.UserId'); + } else { + $this->userId = $this->GrouperGroup->getGrouperUserId(); + $this->Session->write('Plugin.Grouper.UserId', $this->userId); } // Determine what operations this user can perform @@ -530,8 +538,8 @@ public function emaillistsMember() //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => ($this->passedArgs['page'] ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => ($this->passedArgs['limit'] ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), + 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), ]; try { diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index bea20de..1d7a845 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -71,16 +71,13 @@ public function __construct() { } /** - * NOT BEING USED * Get User information from Grouper Web Service * - * @param array $queryData Array of conditions for querying - * @return array + * @return String User ID in Grouper Groups * @throws Exception */ - public function getGrouperUser(array $queryData) { + public function getGrouperUserId() { - $userId = $queryData['userId']; $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); // Create attributes want returned from call to Grouper WS @@ -94,7 +91,7 @@ public function getGrouperUser(array $queryData) { 'givenname' ), 'wsSubjectLookups' => array( - array('subjectIdentifier' => $userId) + array('subjectIdentifier' => $_SERVER['REMOTE_USER']) ) ) ); @@ -114,7 +111,7 @@ public function getGrouperUser(array $queryData) { throw $e; } - return array(); + return ''; } /** diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 89bf151..bf12999 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -100,6 +100,24 @@ private function initApi() { } } + /** + * Gets the users Id from Grouper since can be different than what is in Comanage. + * + * @return String User's Id in Grouper + * @throws Exception + */ + public function getGrouperUserId() { + $this->initApi(); + + try { + return $this->grouperAPI->getGrouperUserId(); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; + } + } + /** * Return all Groups that a User belongs to in Grouper. * Will also add Optin Groups and flag them as joined so can display Optout option in UI. From 1559b0c383a76e13fbb1e7fdeef278be7278e816 Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 29 Mar 2021 09:59:24 -0700 Subject: [PATCH 003/143] fixes for CamelCase URLs --- Controller/CoGrouperLitesController.php | 2 +- Controller/GrouperGroupsController.php | 2 +- View/CoGrouperLites/display.ctp | 12 ++++++------ View/Elements/Components/navigation-emaillists.ctp | 10 +++++----- View/Elements/Components/navigation-groups.ctp | 10 +++++----- View/Elements/Components/optAction.ctp | 2 +- View/Elements/Components/search.ctp | 2 +- View/GrouperGroups/base.ctp | 2 +- View/GrouperGroups/emaillistsmanage.ctp | 2 +- View/GrouperGroups/emaillistsmember.ctp | 2 +- View/GrouperGroups/emaillistsoptin.ctp | 2 +- View/GrouperGroups/groupcreate.ctp | 2 +- View/GrouperGroups/groupcreatetemplate.ctp | 2 +- View/GrouperGroups/groupmember.ctp | 2 +- View/GrouperGroups/groupoptin.ctp | 2 +- View/GrouperGroups/groupowner.ctp | 2 +- 16 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Controller/CoGrouperLitesController.php b/Controller/CoGrouperLitesController.php index 57b143a..ccbaa42 100644 --- a/Controller/CoGrouperLitesController.php +++ b/Controller/CoGrouperLitesController.php @@ -31,7 +31,7 @@ public function display($id) { $this->set('pl_grouperlite_index_url', Router::url([ 'plugin' => "grouper_lite", - 'controller' => 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'index', 'co' => $this->cur_co['Co']['id'], 'glid' => $id diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 97af3e0..b9cd4dd 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -102,7 +102,7 @@ private function setConnection() { */ public function index() { return $this->redirect( - array('controller' => 'GrouperGroups', 'action' => 'groupoptin') + array('controller' => 'grouper_groups', 'action' => 'groupoptin') ); } diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index 6d1e03e..a862e21 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -53,7 +53,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'groupoptin', 'co' => $coid, 'glid' => $glid @@ -64,7 +64,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'groupmember', 'co' => $coid, 'glid' => $glid @@ -76,7 +76,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'groupowner', 'co' => $coid, 'glid' => $glid @@ -93,7 +93,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsoptin', 'co' => $coid, 'glid' => $glid @@ -104,7 +104,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsMember', 'co' => $coid, 'glid' => $glid @@ -116,7 +116,7 @@ echo $this->element('GrouperLite.base-styles'); 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsManage', 'co' => $coid, 'glid' => $glid diff --git a/View/Elements/Components/navigation-emaillists.ctp b/View/Elements/Components/navigation-emaillists.ctp index 7597315..60b3856 100644 --- a/View/Elements/Components/navigation-emaillists.ctp +++ b/View/Elements/Components/navigation-emaillists.ctp @@ -5,7 +5,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.emaillists-join'), array( - 'controller' => 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsoptin' ), array('class' => array('nav-link', $active == 'emaillistsoptin' ? 'active' : '')) @@ -17,7 +17,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.emaillists-member'), array( - 'controller' => 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsmember' ), array('class' => array('nav-link', $active == 'emaillistsmember' ? 'active' : '')) @@ -29,7 +29,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.emaillists-manage'), array( - 'controller' => 'GrouperGroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsmanage' ), array('class' => array('nav-link', $active == 'emaillistsmanage' ? 'active' : '')) @@ -42,7 +42,7 @@ Html->url( array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupcreatetemplateform' ) ); @@ -56,7 +56,7 @@ Html->url( array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupoptin' ) ); diff --git a/View/Elements/Components/navigation-groups.ctp b/View/Elements/Components/navigation-groups.ctp index 636e6c4..d28751b 100644 --- a/View/Elements/Components/navigation-groups.ctp +++ b/View/Elements/Components/navigation-groups.ctp @@ -5,7 +5,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.groups-can-join'), array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupoptin' ), array('class' => array('nav-link', $active == 'groupoptin' ? 'active' : '')) @@ -17,7 +17,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.memberships'), array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupmember' ), array('class' => array('nav-link', $active == 'groupmember' ? 'active' : '')) @@ -29,7 +29,7 @@ print $this->Html->link( _txt('pl.grouperlite.nav.groups-presided'), array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupowner' ), array('class' => array('nav-link', $active == 'groupowner' ? 'active' : '')) @@ -42,7 +42,7 @@ Html->url( array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupcreateform' ) ); @@ -56,7 +56,7 @@ Html->url( array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistsoptin' ) ); diff --git a/View/Elements/Components/optAction.ctp b/View/Elements/Components/optAction.ctp index 2928dca..6ac08f5 100644 --- a/View/Elements/Components/optAction.ctp +++ b/View/Elements/Components/optAction.ctp @@ -1,5 +1,5 @@ Form->create(false, array( - 'url' => array('controller' => 'groupergroups', 'action' => $action), + 'url' => array('controller' => 'grouper_groups', 'action' => $action), 'class' => 'd-flex justify-content-center' )); ?> Form->hidden('GroupName', array('default' => $group)); ?> diff --git a/View/Elements/Components/search.ctp b/View/Elements/Components/search.ctp index ca42a44..8e7a0e6 100644 --- a/View/Elements/Components/search.ctp +++ b/View/Elements/Components/search.ctp @@ -16,7 +16,7 @@ }); Form->create(false, array( - 'url' => array('controller' => 'groupergroups', 'action' => $active), + 'url' => array('controller' => 'grouper_groups', 'action' => $active), 'class' => 'search mb-4' )); ?>
diff --git a/View/GrouperGroups/base.ctp b/View/GrouperGroups/base.ctp index 6b393b3..54aaf95 100644 --- a/View/GrouperGroups/base.ctp +++ b/View/GrouperGroups/base.ctp @@ -6,7 +6,7 @@ print $this->Html->css('GrouperLite.co-grouper-plugin') . "\n "; Html->script('GrouperLite.typeahead.bundle.js') . "\n "; -$this->Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => 'groupergroups', 'action' => 'groupoptin'), array('prepend' => true)); +$this->Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => 'grouper_groups', 'action' => 'groupoptin'), array('prepend' => true)); ?>
diff --git a/View/GrouperGroups/emaillistsmanage.ctp b/View/GrouperGroups/emaillistsmanage.ctp index 3c3c41c..d783ae9 100644 --- a/View/GrouperGroups/emaillistsmanage.ctp +++ b/View/GrouperGroups/emaillistsmanage.ctp @@ -18,7 +18,7 @@ Html->link( isset($group['name']) ? $group['domain'] . ':' . $group['name'] : "--", array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistinfo', '?' => array('groupname' => urlencode($group['name'])) ) diff --git a/View/GrouperGroups/emaillistsmember.ctp b/View/GrouperGroups/emaillistsmember.ctp index ed1264a..45d17c5 100644 --- a/View/GrouperGroups/emaillistsmember.ctp +++ b/View/GrouperGroups/emaillistsmember.ctp @@ -18,7 +18,7 @@ Html->link( isset($group['name']) ? $group['domain'].':'.$group['name'] : "No Name", array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistinfo', '?' => array('groupname' => urlencode($group['name'])) ) diff --git a/View/GrouperGroups/emaillistsoptin.ctp b/View/GrouperGroups/emaillistsoptin.ctp index a980633..d049a5d 100644 --- a/View/GrouperGroups/emaillistsoptin.ctp +++ b/View/GrouperGroups/emaillistsoptin.ctp @@ -18,7 +18,7 @@ Html->link( isset($group['name']) ? $group['domain'] . ':' . $group['name'] : "No Name", array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'emaillistinfo', '?' => array('groupname' => urlencode($group['name'])) ) diff --git a/View/GrouperGroups/groupcreate.ctp b/View/GrouperGroups/groupcreate.ctp index c3bf238..df9058c 100644 --- a/View/GrouperGroups/groupcreate.ctp +++ b/View/GrouperGroups/groupcreate.ctp @@ -15,7 +15,7 @@ $model = $this->name; Form->create(false, array( - 'url' => array('controller' => 'groupergroups', 'action' => 'groupcreate') + 'url' => array('controller' => 'grouper_groups', 'action' => 'groupcreate') )); ?> plugin)) { diff --git a/View/GrouperGroups/groupcreatetemplate.ctp b/View/GrouperGroups/groupcreatetemplate.ctp index c7db590..f5b9bd9 100644 --- a/View/GrouperGroups/groupcreatetemplate.ctp +++ b/View/GrouperGroups/groupcreatetemplate.ctp @@ -10,7 +10,7 @@ $model = $this->name;
Form->create(false, array( - 'url' => array('controller' => 'groupergroups', 'action' => 'groupcreatetemplate') + 'url' => array('controller' => 'grouper_groups', 'action' => 'groupcreatetemplate') )); ?> plugin)) { diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 561fa98..c5b1803 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -23,7 +23,7 @@ Html->url( array( - 'controller' => 'groupergroups', + 'controller' => 'grouper_groups', 'action' => 'groupinfo', '?' => array('groupname' => urlencode($group['name'])) ) diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 593b2b3..413f3cd 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -24,7 +24,7 @@ " class="btn btn-grouper btn btn-primary btn btn-raised btn btn-block" target="_blank" role="button"> + @@ -20,7 +20,7 @@ - +

diff --git a/View/Elements/Components/navigation-groups.ctp b/View/Elements/Components/navigation-groups.ctp index d28751b..4b54c44 100644 --- a/View/Elements/Components/navigation-groups.ctp +++ b/View/Elements/Components/navigation-groups.ctp @@ -43,7 +43,7 @@ $createGroupUrl = $this->Html->url( array( 'controller' => 'grouper_groups', - 'action' => 'groupcreateform' + 'action' => 'groupcreate' ) ); ?> From fdb4f26587308ebd4f7643d46d9ddb4a47b7530d Mon Sep 17 00:00:00 2001 From: axman Date: Wed, 31 Mar 2021 15:14:14 -0700 Subject: [PATCH 006/143] fixed issues in ticket --- Lib/GrouperApiAccess.php | 51 ++++++------------- Lib/lang.php | 1 + Model/GrouperGroup.php | 7 +-- .../Elements/Components/navigation-groups.ctp | 15 ++++++ View/GrouperGroups/emaillistinfo.ctp | 2 +- View/GrouperGroups/groupinfo.ctp | 2 +- 6 files changed, 35 insertions(+), 43 deletions(-) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index 1d7a845..c43a156 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -36,13 +36,13 @@ class GrouperApiAccess { // Array for storing settings needed in call to Grouper - private $config; + private array $config; // Instance of Grouper HTTP Wrapper class - private $http; + private GrouperHTTPWrapper $http; // String used to build out Grouper WS URL - private $_urlServlet = '/grouper-ws/servicesRest/'; + private string $_urlServlet = '/grouper-ws/servicesRest/'; /** * GrouperApiAccess constructor. @@ -364,32 +364,6 @@ private function useMembershipUrl(array $queryData) { } } - /** - * Returns a Distinct Grouper Group with its associated values - * - * @param array $queryData Array of conditions for querying - * @return array Array of attributes for a Group - * @throws GrouperLiteException - */ - public function getGrouperGroupDescription(array $queryData) { - $groupName = $queryData['groupName']; - - //Build request logic - $groupName = urlencode($groupName); - $connectionUrl = "{$this->config['fullUrl']}/groups/{$groupName}/memberships"; - - try { - $results = $this->http->sendRequest('GET', $connectionUrl); - - if (isset($results['WsGetMembershipsResults']['wsGroups']) && $results['WsGetMembershipsResults']['wsGroups'] != NULL) { - return $results['WsGetMembershipsResults']['wsGroups']; - } - } catch (Exception $e) { - CakeLog::write('error', __METHOD__ . ': An error occurred'); - throw $e; - } - return array(); - } /** * Method used to CREATE a new Group in Grouper via the Template method. @@ -481,7 +455,7 @@ public function deleteGroupWithTemplate(array $queryData) { $connectionUrl = "{$this->config['fullUrl']}/gshTemplateExec"; try { - $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($groupToSave)); + $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($groupToDelete)); if (isset($results['WsGshTemplateExecResult']['resultMetadata']['resultCode'])) { if (stripos($results['WsGshTemplateExecResult']['resultMetadata']['resultCode'], "SUCCESS", 0) !== false) { @@ -558,15 +532,15 @@ public function createUpdateGroup(array $queryData) { } /** - * Listing of attributes in Grouper for a given Group Name + * Grouper Group information plus a listing of attributes in Grouper for that given Group * * @param array $queryData Array of conditions for querying * @return array Record of Grouper attributes for given GroupName * @throws GrouperLiteException */ - public function getGroupAttributes(array $queryData) { - // Need to pass in the full stem path, so thing like sandbox:app:sympa are good! + public function getGrouperGroupInfo(array $queryData) { $groupName = $queryData['groupName']; + $groupInfo = array(); //Build request logic $stemToFind = array( @@ -586,14 +560,21 @@ public function getGroupAttributes(array $queryData) { try { $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($stemToFind)); + //Get the group information + if (isset($results['WsGetAttributeAssignmentsResults']['wsGroups']) && $results['WsGetAttributeAssignmentsResults']['wsGroups'] != NULL) { + $groupInfo = $results['WsGetAttributeAssignmentsResults']['wsGroups']; + } + + //Now get the Group Attributes and add them to group if (isset($results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns']) && $results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns'] != NULL) { - return $results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns']; + $groupInfo[0]["attributes"] = $results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns']; } + + return $groupInfo; } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); throw $e; } - return array(); } } diff --git a/Lib/lang.php b/Lib/lang.php index fc692eb..8b5af83 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -16,6 +16,7 @@ 'pl.grouperlite.nav.emaillists-member' => 'My email lists', 'pl.grouperlite.nav.emaillists-manage' => 'Email lists I manage', 'pl.grouperlite.nav.create-group' => 'Create group', + 'pl.grouperlite.nav.create-working-group' => 'Create working group', 'pl.grouperlite.nav.create-email' => 'Create email list', 'pl.grouperlite.nav.emaillists' => 'Email Lists', 'pl.grouperlite.nav.groups' => 'Groups', diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index bf12999..fb3c7f4 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -245,14 +245,9 @@ public function groupDescriptions(string $groupName) { $args = array(); $args['groupName'] = $groupName; - $groupDescription = $this->grouperAPI->getGrouperGroupDescription($args); + $groupDescription = $this->grouperAPI->getGrouperGroupInfo($args); $groupInfo = $this->getFriendlyName($groupDescription); - //make call to get attributes for group - $grouperAtt = new GrouperAttribute(); - $groupAttributes = $grouperAtt->getGroupAttributes($groupName); - - $groupInfo[0]["attributes"] = $groupAttributes; return $groupInfo; } catch (Exception $e) { diff --git a/View/Elements/Components/navigation-groups.ctp b/View/Elements/Components/navigation-groups.ctp index 4b54c44..aadcef4 100644 --- a/View/Elements/Components/navigation-groups.ctp +++ b/View/Elements/Components/navigation-groups.ctp @@ -52,6 +52,21 @@
+ +
+ Html->url( + array( + 'controller' => 'grouper_groups', + 'action' => 'groupcreatetemplate' + ) + ); + ?> + +   + +
+
Html->url( diff --git a/View/GrouperGroups/emaillistinfo.ctp b/View/GrouperGroups/emaillistinfo.ctp index daa4379..4eaa7f7 100644 --- a/View/GrouperGroups/emaillistinfo.ctp +++ b/View/GrouperGroups/emaillistinfo.ctp @@ -62,7 +62,7 @@ $attrUrlBase = $baseUrl . $path . $attrOperation; element('Components/subscriberList', array('subscribers' => $groupergroupssubscribers)); ?>
diff --git a/View/GrouperGroups/groupinfo.ctp b/View/GrouperGroups/groupinfo.ctp index c668513..a989fa0 100644 --- a/View/GrouperGroups/groupinfo.ctp +++ b/View/GrouperGroups/groupinfo.ctp @@ -63,7 +63,7 @@ $attrUrlBase = $baseUrl . $path . $attrOperation; element('Components/subscriberList', array('subscribers' => $groupergroupssubscribers)); ?>
From 9e33c0410793f1d0abbde78bd1a715005448eb03 Mon Sep 17 00:00:00 2001 From: axman Date: Thu, 1 Apr 2021 08:54:54 -0700 Subject: [PATCH 007/143] fixed display issue --- Lib/GrouperApiAccess.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index c43a156..67fad1e 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -36,13 +36,13 @@ class GrouperApiAccess { // Array for storing settings needed in call to Grouper - private array $config; + private $config; // Instance of Grouper HTTP Wrapper class - private GrouperHTTPWrapper $http; + private $http; // String used to build out Grouper WS URL - private string $_urlServlet = '/grouper-ws/servicesRest/'; + private $_urlServlet = '/grouper-ws/servicesRest/'; /** * GrouperApiAccess constructor. From 30d67fc97a47a956bd89aea71de6f3e7cc14b77f Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 1 Apr 2021 11:00:53 -0700 Subject: [PATCH 008/143] Fixed language --- Lib/lang.php | 4 ++-- View/GrouperGroups/emaillistsmanage.ctp | 2 +- View/GrouperGroups/emaillistsmember.ctp | 2 +- View/GrouperGroups/emaillistsoptin.ctp | 2 +- View/GrouperGroups/groupcreate.ctp | 2 +- View/GrouperGroups/groupcreatetemplate.ctp | 2 +- View/GrouperGroups/groupinfo.ctp | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Lib/lang.php b/Lib/lang.php index 943488d..b4df823 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -33,8 +33,8 @@ 'pl.grouperlite.title.emaillists-member' => 'My email lists', 'pl.grouperlite.title.emaillists-manage' => 'Email lists I manage', 'pl.grouperlite.title.emaillistsinfo' => 'Email list configuration and attributes', - 'pl.grouperlite.title.groupcreate' => 'Create Group', - 'pl.grouperlite.title.templatecreate' => 'Create a Templated Group', + 'pl.grouperlite.title.groupcreate' => 'Create a group', + 'pl.grouperlite.title.templatecreate' => 'Create a working group', 'pl.grouperlite.message.flash.join-group-success' => 'You have been added to the group!', 'pl.grouperlite.message.flash.join-group-failed' => 'You are unable to join the group!', diff --git a/View/GrouperGroups/emaillistsmanage.ctp b/View/GrouperGroups/emaillistsmanage.ctp index 0a9bde0..cf9b0fe 100644 --- a/View/GrouperGroups/emaillistsmanage.ctp +++ b/View/GrouperGroups/emaillistsmanage.ctp @@ -1,5 +1,5 @@ extend('/GrouperGroups/base'); ?> -Html->addCrumb('Email lists I manage'); ?> +Html->addCrumb(_txt('pl.grouperlite.title.emaillists-manage')); ?> element('Components/navigation-emaillists', array('active' => 'emaillistsmanage', 'create' => true)); ?> element('Components/search', array('active' => 'emaillistsmanaged')); ?>
diff --git a/View/GrouperGroups/emaillistsmember.ctp b/View/GrouperGroups/emaillistsmember.ctp index 16e92a1..3da5f92 100644 --- a/View/GrouperGroups/emaillistsmember.ctp +++ b/View/GrouperGroups/emaillistsmember.ctp @@ -1,5 +1,5 @@ extend('/GrouperGroups/base'); ?> -Html->addCrumb('Email lists I can join'); ?> +Html->addCrumb(_txt('pl.grouperlite.title.emaillists-member')); ?> element('Components/navigation-emaillists', array('active' => 'emaillistsmember')); ?> element('Components/search', array('active' => 'emaillistsmember')); ?> diff --git a/View/GrouperGroups/emaillistsoptin.ctp b/View/GrouperGroups/emaillistsoptin.ctp index 9490846..b1460f4 100644 --- a/View/GrouperGroups/emaillistsoptin.ctp +++ b/View/GrouperGroups/emaillistsoptin.ctp @@ -1,5 +1,5 @@ extend('/GrouperGroups/base'); ?> -Html->addCrumb('Email lists I can join'); ?> +Html->addCrumb(_txt('pl.grouperlite.title.emaillists-join')); ?> element('Components/navigation-emaillists', array('active' => 'emaillistsoptin')); ?> element('Components/search', array('active' => 'emaillistsoptin')); ?> diff --git a/View/GrouperGroups/groupcreate.ctp b/View/GrouperGroups/groupcreate.ctp index df9058c..25e446c 100644 --- a/View/GrouperGroups/groupcreate.ctp +++ b/View/GrouperGroups/groupcreate.ctp @@ -1,6 +1,6 @@ extend('/GrouperGroups/base'); -$this->Html->addCrumb('Create a Group'); +$this->Html->addCrumb(_txt('pl.grouperlite.title.groupcreate')); $model = $this->name; ?> diff --git a/View/GrouperGroups/groupcreatetemplate.ctp b/View/GrouperGroups/groupcreatetemplate.ctp index f5b9bd9..a30930d 100644 --- a/View/GrouperGroups/groupcreatetemplate.ctp +++ b/View/GrouperGroups/groupcreatetemplate.ctp @@ -1,6 +1,6 @@ extend('/GrouperGroups/base'); -$this->Html->addCrumb('Create a Templated Group'); +$this->Html->addCrumb(_txt('pl.grouperlite.title.templatecreate')); $model = $this->name; ?> diff --git a/View/GrouperGroups/groupinfo.ctp b/View/GrouperGroups/groupinfo.ctp index a989fa0..57c6176 100644 --- a/View/GrouperGroups/groupinfo.ctp +++ b/View/GrouperGroups/groupinfo.ctp @@ -1,5 +1,5 @@ extend('/GrouperGroups/base'); ?> -Html->addCrumb('Group configuration'); ?> +Html->addCrumb(_txt('pl.grouperlite.title.groupinfo')); ?> Date: Thu, 1 Apr 2021 11:16:22 -0700 Subject: [PATCH 009/143] Fixed search button sizing --- View/Elements/Components/search.ctp | 4 ++-- webroot/css/co-grouper-plugin.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/View/Elements/Components/search.ctp b/View/Elements/Components/search.ctp index acd9fe7..8e01ef4 100644 --- a/View/Elements/Components/search.ctp +++ b/View/Elements/Components/search.ctp @@ -27,8 +27,8 @@
-
- -
- Html->url( - array( - 'controller' => 'grouper_groups', - 'action' => 'groupcreatetemplate' - ) - ); - ?> - -   - -
- + +
+ Html->url( + array( + 'controller' => 'grouper_groups', + 'action' => 'groupcreatetemplate' + ) + ); + ?> + +   + +
+
Html->url( diff --git a/View/Elements/base-styles.ctp b/View/Elements/base-styles.ctp index 694c648..d000702 100644 --- a/View/Elements/base-styles.ctp +++ b/View/Elements/base-styles.ctp @@ -20,7 +20,7 @@ max-width: 220px; } - .grouper .btn:hover { + .grouper .btn:not([disabled]):hover { text-decoration: none !important; filter: brightness(1.1); } diff --git a/View/GrouperGroups/emaillistsmanage.ctp b/View/GrouperGroups/emaillistsmanage.ctp index cf9b0fe..7080913 100644 --- a/View/GrouperGroups/emaillistsmanage.ctp +++ b/View/GrouperGroups/emaillistsmanage.ctp @@ -32,11 +32,11 @@ - + */ ?> - + diff --git a/View/GrouperGroups/groupcreatetemplate.ctp b/View/GrouperGroups/groupcreatetemplate.ctp index a30930d..d465236 100644 --- a/View/GrouperGroups/groupcreatetemplate.ctp +++ b/View/GrouperGroups/groupcreatetemplate.ctp @@ -7,7 +7,7 @@ $model = $this->name;
-
+
Form->create(false, array( 'url' => array('controller' => 'grouper_groups', 'action' => 'groupcreatetemplate') diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 0e1baa1..b4a1cae 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -33,11 +33,11 @@ - - diff --git a/View/GrouperGroups/templatefields.inc b/View/GrouperGroups/templatefields.inc index c01d6f0..5b4d338 100644 --- a/View/GrouperGroups/templatefields.inc +++ b/View/GrouperGroups/templatefields.inc @@ -2,7 +2,7 @@
Form->label(false, _txt('pl.grouperlite.form.template.work-group-extension.label'), array( 'for' => 'gsh_input_workingGroupExtension', - 'class' => "col-sm-3 col-form-label" + 'class' => "col-sm-3 col-form-label d-flex align-items-center" )); ?>
Form->input('gsh_input_workingGroupExtension', array( @@ -17,7 +17,7 @@
Form->label(false, _txt('pl.grouperlite.form.template.work-group-disp-extension.label'), array( 'for' => 'gsh_input_workingGroupDisplayExtension', - 'class' => "col-sm-3 col-form-label" + 'class' => "col-sm-3 col-form-label d-flex align-items-center" )); ?>
Form->input('gsh_input_workingGroupDisplayExtension', array( @@ -31,7 +31,7 @@
Form->label(false, _txt('pl.grouperlite.form.template.work-group-description.label'), array( 'for' => 'gsh_input_workingGroupDescription', - 'class' => "col-sm-3 col-form-label" + 'class' => "col-sm-3 col-form-label d-flex align-items-center" )); ?>
Form->input('gsh_input_workingGroupDescription', array( @@ -43,7 +43,7 @@
- +
Form->input( 'gsh_input_isSympa', @@ -52,7 +52,7 @@ 'class' => 'form-check-input', 'legend' => false, 'id' => 'gsh_input_isSympa', - 'before' => '
', + 'before' => '
', 'separator' => '
', 'after' => '
', 'options' => array( @@ -66,7 +66,7 @@
- +
Form->input( 'gsh_input_sympaDomain', @@ -88,7 +88,7 @@
- +
Form->input( 'gsh_input_isSympaModerated', @@ -111,7 +111,7 @@
- +
Form->input( 'gsh_input_isOptin', @@ -151,7 +151,7 @@
-->
- +
Form->input( 'gsh_input_isConfluence', @@ -174,7 +174,7 @@
- +
Form->input( 'gsh_input_isJira', diff --git a/webroot/css/co-grouper-plugin.css b/webroot/css/co-grouper-plugin.css index 9f12e4a..a8aad4d 100644 --- a/webroot/css/co-grouper-plugin.css +++ b/webroot/css/co-grouper-plugin.css @@ -20,7 +20,7 @@ a { color: var(--primary); } -#grouper-plugin .btn.btn-primary:hover { +#grouper-plugin .btn.btn-primary:not([disabled]):hover { background-color: black; border-color: black; } @@ -272,4 +272,8 @@ a.list-group-item-action:hover .fa { .grouper .pagination .muted { color: rgba(255, 255, 255, 0.8); +} + +.radio .form-check-inline label { + margin-bottom: 0; } \ No newline at end of file From 29f352cf391f266e7d9cccaccb5e7ed4039864dc Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 1 Apr 2021 12:25:47 -0700 Subject: [PATCH 011/143] Fixed issue from merge conflict --- View/Elements/Components/groupattributes.ctp | 44 ++++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/View/Elements/Components/groupattributes.ctp b/View/Elements/Components/groupattributes.ctp index 67019c8..2c0ff8b 100644 --- a/View/Elements/Components/groupattributes.ctp +++ b/View/Elements/Components/groupattributes.ctp @@ -1,29 +1,27 @@ - 0) : ?> - - +
+ + + + + + + + + - - - + + + - - - - - - - - - - -
+ + + +
- - - -
- + + +
-

+

\ No newline at end of file From c27d6a8b1e1711a06c32cf538d72860d3ce4c60a Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 5 Apr 2021 14:33:06 -0700 Subject: [PATCH 012/143] fixed bug --- Lib/GrouperApiAccess.php | 13 ++++++++----- Model/GrouperGroup.php | 16 ++++++++++------ View/GrouperGroups/groupmember.ctp | 4 ++-- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index 67fad1e..ee80616 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -203,17 +203,16 @@ public function grouperGroupLeaveOrJoin(array $queryData) { } /** - * Gets all available Optin groups in Grouper - * Checks to see which Optin groups the user is already a member of - * Returns Optin groups that can be joined and ones that the user is already joined + * Gets all available Optin/OptOut groups in Grouper + * + * Returns Optin/OptOut groups that can be joined/left * * @param array $queryData Array of conditions for querying * @return array Optin groups from Grouper * @throws GrouperLiteException * */ - public function getOptinGroups(array $queryData) { - $queryData['groupType'] = 'Optins'; + public function getOptionalGroups(array $queryData) { try { $results = $this->useMembershipUrl($queryData); @@ -319,6 +318,7 @@ public function getOwnedStems(array $queryData) { * Used for requests made to Membership endpoint in Grouper WS * * @see getOptinGroups() + * @see getOptOutGroups() * @see getOwnedGroups() * @see getOwnedStems() * @@ -333,6 +333,9 @@ private function useMembershipUrl(array $queryData) { if ($groupType == 'Optins') { $fieldName = "optins"; $subjectId = "GrouperAll"; + } elseif ($groupType == 'Optouts') { + $fieldName = "optouts"; + $subjectId = "GrouperAll"; } elseif ($groupType == 'Owner') { $fieldName = "admin"; $subjectId = $userId; diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index fb3c7f4..548cb2b 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -120,7 +120,7 @@ public function getGrouperUserId() { /** * Return all Groups that a User belongs to in Grouper. - * Will also add Optin Groups and flag them as joined so can display Optout option in UI. + * Will also add OptOut Groups and flag them as joined so can display Optout option in UI. * * @param array $conditions Listing of conditions for display of records, including UserId * @return array Records of Groups from Grouper that the User belongs to @@ -131,18 +131,19 @@ public function filteredMemberOfGroups(array $conditions) { $this->initApi(); try { + $conditions['groupType'] = 'Optouts'; $memberOfGroups = $this->memberOfGroups($conditions); // Determine which groups can be left by user, if want. - $optInGroups = $this->grouperAPI->getOptinGroups($conditions); + $optOutGroups = $this->grouperAPI->getOptionalGroups($conditions); foreach ($memberOfGroups as &$memberOfGroup) { - foreach ($optInGroups as $key => $value) { + foreach ($optOutGroups as $key => $value) { if ($value['name'] == $memberOfGroup['name']) { //Match! - $memberOfGroup['optedin'] = true; + $memberOfGroup['optOut'] = true; //Remove Optin group since already found and now less loops - unset($optInGroups[$key]); + unset($optOutGroups[$key]); break; } } @@ -157,6 +158,7 @@ public function filteredMemberOfGroups(array $conditions) { } public function filteredMemberOfEmails(array $conditions) { + $memberOfEmails = $this->filteredMemberOfGroups($conditions); // Strip out all Groups that are not in Sympa Stem/Directory @@ -364,7 +366,9 @@ public function optinGroups(array $conditions) { $this->initApi(); try { - $joinOrLeave = $this->grouperAPI->getOptinGroups($conditions); + $conditions['groupType'] = 'Optins'; + + $joinOrLeave = $this->grouperAPI->getOptionalGroups($conditions); $userGroups = $this->memberOfGroups($conditions); //See if Optin group match any of the groups user already belongs to. diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 8e0c956..d4fb8b3 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -30,8 +30,8 @@ ) ?>" title=""> - element('GrouperLite.Components/optAction', array( - 'member' => $group['optedin'], + element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], 'action' => 'leavegroup', 'group' => $group['name'] )) : ''; ?> From d12d5bbf93c77b15c1c87f56badf2a2a378c7896 Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 5 Apr 2021 14:43:29 -0700 Subject: [PATCH 013/143] carry over from I2 branch --- Lib/GrouperApiAccess.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index ee80616..fbb6584 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -571,6 +571,8 @@ public function getGrouperGroupInfo(array $queryData) { //Now get the Group Attributes and add them to group if (isset($results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns']) && $results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns'] != NULL) { $groupInfo[0]["attributes"] = $results['WsGetAttributeAssignmentsResults']['wsAttributeAssigns']; + } else { + $groupInfo[0]["attributes"] = array(); } return $groupInfo; From 5c1f122fb5351a65bbc94101b798cb1cfa87f7d3 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 6 Apr 2021 12:25:22 -0700 Subject: [PATCH 014/143] Fixed issues with accessibility, improved ux, added zero states --- Lib/lang.php | 5 +- View/Elements/Components/groupattributes.ctp | 42 +++---- .../Components/navigation-emaillists.ctp | 8 +- View/Elements/Components/optAction.ctp | 5 +- View/Elements/Components/search.ctp | 3 +- View/GrouperGroups/base.ctp | 2 +- View/GrouperGroups/emaillistsmanage.ctp | 108 ++++++++++-------- View/GrouperGroups/emaillistsmember.ctp | 86 +++++++------- View/GrouperGroups/emaillistsoptin.ctp | 84 +++++++------- View/GrouperGroups/groupinfo.ctp | 4 +- View/GrouperGroups/groupmember.ctp | 94 ++++++++------- View/GrouperGroups/groupoptin.ctp | 14 ++- View/GrouperGroups/groupowner.ctp | 108 ++++++++++-------- 13 files changed, 308 insertions(+), 255 deletions(-) diff --git a/Lib/lang.php b/Lib/lang.php index b4df823..0eaeaea 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -96,6 +96,7 @@ 'pl.grouperlite.action.view-in-grouper' => 'View in Grouper', 'pl.grouperlite.action.view-members' => 'View members', 'pl.grouperlite.action.close' => 'Close', + 'pl.grouperlite.action.clear' => 'Clear', 'pl.grouperlite.form.group.template.label' => 'Select a template', 'pl.grouperlite.form.group.template.empty' => '(choose one)', @@ -133,5 +134,7 @@ 'pl.grouperlite.search.tags.text' => 'Search', 'pl.grouperlite.pagination.counter' => 'Viewing {:start}-{:end} of {:count}', - 'pl.grouperlite.attributes.zero-state' => 'No Attributes Associated to this Group.' + 'pl.grouperlite.attributes.zero-state' => 'No Attributes Associated to this Group.', + 'pl.grouperlite.groups.zero-state' => 'No groups found.', + 'pl.grouperlite.working-groups.zero-state' => 'No working groups found.' ); \ No newline at end of file diff --git a/View/Elements/Components/groupattributes.ctp b/View/Elements/Components/groupattributes.ctp index 2c0ff8b..8710b23 100644 --- a/View/Elements/Components/groupattributes.ctp +++ b/View/Elements/Components/groupattributes.ctp @@ -1,25 +1,27 @@ - - - - - - - - - - + 0) : ?> +
+ - - - + + + - - -
- - - -
+ + + + + + + + + + + + + + + +

diff --git a/View/Elements/Components/navigation-emaillists.ctp b/View/Elements/Components/navigation-emaillists.ctp index 60b3856..6b478db 100644 --- a/View/Elements/Components/navigation-emaillists.ctp +++ b/View/Elements/Components/navigation-emaillists.ctp @@ -40,15 +40,15 @@
Html->url( + $createTemplateGroupUrl = $this->Html->url( array( 'controller' => 'grouper_groups', - 'action' => 'groupcreatetemplateform' + 'action' => 'groupcreatetemplate' ) ); ?> - -   + +  
diff --git a/View/Elements/Components/optAction.ctp b/View/Elements/Components/optAction.ctp index 6ac08f5..cf6504a 100644 --- a/View/Elements/Components/optAction.ctp +++ b/View/Elements/Components/optAction.ctp @@ -1,8 +1,9 @@ Form->create(false, array( 'url' => array('controller' => 'grouper_groups', 'action' => $action), - 'class' => 'd-flex justify-content-center' + 'class' => 'd-flex justify-content-center', + 'id' => 'join-group.' . $idx )); ?> -Form->hidden('GroupName', array('default' => $group)); ?> +Form->hidden('GroupName', array('default' => $group, 'id' => 'groupName.'.$idx)); ?> diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index d4fb8b3..734a40c 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -2,48 +2,56 @@ Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - - - - - - - + 0) : ?> +
+ element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
+ - - - + + + - - -
- element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'] - )) : ''; ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
\ No newline at end of file + + + $group) : ?> + + + + + element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> + + + + + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?> +
+ + +
+

+
+ \ No newline at end of file diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index a3acc65..e17a2c7 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -2,6 +2,7 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?> element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?> + 0) : ?>
element("pagination", array( 'goto' => false, @@ -19,7 +20,7 @@ - + $group) : ?> +

+
+ \ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index b4a1cae..0654d39 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -2,55 +2,63 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-presided')); ?> element('Components/navigation-groups', array('active' => 'groupowner')); ?> element('Components/search', array('active' => 'groupowner')); ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - - - - - - - - + + 0) : ?> +
+ element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
+ - - - - + + + + - - -
- - - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
\ No newline at end of file + + + + +
+ + + + + + + + + + + + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?> +
+ + +
+

+
+ \ No newline at end of file From 0ea94366e26e14adaa0ef8d307ab518ee15c9682 Mon Sep 17 00:00:00 2001 From: axman Date: Thu, 8 Apr 2021 15:44:13 -0700 Subject: [PATCH 015/143] fixed error on Sympa Groups --- Lib/GrouperApiAccess.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index fbb6584..69689c2 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -382,6 +382,12 @@ public function createGroupWithTemplate(array $queryData) { $data = $queryData['data']; $userId = $queryData['userId']; + //need to take out SympaDomain if domain not being created. + if ($data['gsh_input_isSympa'] == 'false') { + unset($data['gsh_input_sympaDomain']); + unset($data['gsh_input_isSympaModerated']); + } + //Build request logic $inputFields = array(); foreach($data as $key => $value) { From b3161bbd848a601043119fb152cbf66e3e5051d1 Mon Sep 17 00:00:00 2001 From: axman Date: Tue, 6 Jul 2021 14:49:09 -0700 Subject: [PATCH 016/143] Group Grouping for WG --- Controller/GrouperGroupsController.php | 116 ++++++++++--- Model/GrouperGroup.php | 143 ++++++++++++---- PlantUML/1.puml | 75 +++++++++ PlantUML/2.puml | 25 +++ PlantUML/3.puml | 46 ++++++ PlantUML/4.puml | 64 ++++++++ PlantUML/5.puml | 121 ++++++++++++++ PlantUML/6.puml | 27 +++ PlantUML/7.puml | 63 +++++++ PlantUML/GroupsBelongTo.puml | 219 +++++++++++++++++++++++++ PlantUML/MyMemberProcess.puml | 219 +++++++++++++++++++++++++ View/GrouperGroups/groupmember.ctp | 40 ++++- View/GrouperGroups/groupoptin.ctp | 89 ++++++---- View/GrouperGroups/groupowner.ctp | 111 +++++++++---- 14 files changed, 1235 insertions(+), 123 deletions(-) create mode 100644 PlantUML/1.puml create mode 100644 PlantUML/2.puml create mode 100644 PlantUML/3.puml create mode 100644 PlantUML/4.puml create mode 100644 PlantUML/5.puml create mode 100644 PlantUML/6.puml create mode 100644 PlantUML/7.puml create mode 100644 PlantUML/GroupsBelongTo.puml create mode 100644 PlantUML/MyMemberProcess.puml diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 502c271..5257ba8 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -77,7 +77,6 @@ public function beforeFilter() { $this->setConnection(); } - //Need to verify if user is part of } /** @@ -180,8 +179,8 @@ public function groupOwner() { //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => ($this->passedArgs['page'] ?? $this->paginate['page']), + 'limit' => ($this->passedArgs['limit'] ?? $this->paginate['limit']), ]; if (isset($this->request->data['search'])) { @@ -195,12 +194,24 @@ public function groupOwner() { $scope['searchpage'] = 'ownerGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupsowner', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupsowners', $notWGData); + $this->set('wgowners', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); - $this->set('groupergroupsowner', array()); + $this->set('groupsowners', array()); $this->Flash->set(_txt('pl.grouperlite.message.flash.owner-group-failed'), array('key' => 'error')); return; } @@ -209,12 +220,25 @@ public function groupOwner() { $scope['method'] = 'ownerGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupsowner', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupsowners', $notWGData); + $this->set('wgowners', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); - $this->set('groupergroupsowner', array()); + $this->set('groupsowners', array()); + $this->set('wgowners', array()); $this->Flash->set(_txt('pl.grouperlite.message.flash.owner-group-failed'), array('key' => 'error')); return; } @@ -235,8 +259,8 @@ public function groupMember() { //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => ($this->passedArgs['page'] ?? $this->paginate['page']), + 'limit' => ($this->passedArgs['limit'] ?? $this->paginate['limit']), ]; if (isset($this->request->data['search'])) { @@ -250,13 +274,26 @@ public function groupMember() { $scope['searchpage'] = 'filteredMemberOfGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupmemberships', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupmemberships', $notWGData); + $this->set('wgmemberships', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); $this->Flash->set("Your Search Group cannot be found, please try again later.", array('key' => 'error')); - $this->set('groupergroupmemberships', array()); + $this->set('groupmemberships', array()); + $this->set('wgmemberships', array()); return; } } else { @@ -265,13 +302,26 @@ public function groupMember() { $scope['method'] = 'filteredMemberOfGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupmemberships', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupmemberships', $notWGData); + $this->set('wgmemberships', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); $this->Flash->set("Your Member Group cannot be found, please try again later.", array('key' => 'error')); - $this->set('groupergroupmemberships', array()); + $this->set('groupmemberships', array()); + $this->set('wgmemberships', array()); return; } } @@ -288,8 +338,8 @@ public function groupOptin() { //Set initial settings for pagination $scope = [ 'userId' => $this->userId, - 'page' => (isset($this->passedArgs['page']) ? $this->passedArgs['page']: $this->paginate['page']), - 'limit' => (isset($this->passedArgs['limit']) ? $this->passedArgs['limit']: $this->paginate['limit']), + 'page' => ($this->passedArgs['page'] ?? $this->paginate['page']), + 'limit' => ($this->passedArgs['limit'] ?? $this->paginate['limit']), ]; if (isset($this->request->data['search'])) { @@ -303,13 +353,27 @@ public function groupOptin() { $scope['searchpage'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupoptin', $data); + //$this->set('groupoptin', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupoptins', $notWGData); + $this->set('wgoptins', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . 'Search: ' . var_export($e->getMessage(), true)); $this->Flash->set("Your Optin Group Search cannot be found, please try again later.", array('key' => 'error')); - $this->set('groupergroupoptin', array()); + $this->set('groupoptins', array()); + $this->set('wgoptins', array()); return; } } else { @@ -318,12 +382,26 @@ public function groupOptin() { $scope['method'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - $this->set('groupergroupoptin', $data); + //$this->set('groupoptin', $data); + + $wgData = array(); + $notWGData = array(); + foreach($data as $group) { + if(isset($group['WGName'])) { + $wgData[] = $group; + } else { + $notWGData[] = $group; + } + } + + $this->set('groupoptins', $notWGData); + $this->set('wgoptins', $wgData); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); $this->Flash->set("An error occurred with the Optin Groups, please try again later.", array('key' => 'error')); - $this->set('groupergroupoptin', array()); + $this->set('groupoptins', array()); + $this->set('wgoptins', array()); return; } } diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 548cb2b..4e12b1c 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -47,6 +47,13 @@ class GrouperGroup extends GrouperLiteAppModel /** @var string Group whose members can create Groups via Template process*/ private $templateCreationGroup = 'ref:workinggroupadmins'; + private $stemsWorkingGroup = array( + 'app:jira', + 'app:confluence', + 'app:sympa:internet2', + 'app:sympa:incommon', + 'ref:incommon-collab' + ); /** * Verifies if user is an owner/admin of a group and then stores results in Session. @@ -149,7 +156,7 @@ public function filteredMemberOfGroups(array $conditions) { } } - return $this->getFriendlyName($memberOfGroups); + return array_values($memberOfGroups); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); @@ -168,7 +175,7 @@ public function filteredMemberOfEmails(array $conditions) { } } - return $memberOfEmails; + return array_values($memberOfEmails); } /** @@ -190,6 +197,78 @@ private function memberOfGroups(array $conditions) { } } + + private function getFriendlyWorkingGroupName(array $groups) { + + $arrayIndex = 0; + foreach ($groups as &$group) { + foreach($this->stemsWorkingGroup as $stem) { + $len = strlen($stem); + if (substr(strtolower($group['name']), 0, $len) === $stem){ + $stemSections = explode(':', $group['name']); + //Get second to last stem section + $sectionCount = count($stemSections) - 2; + $group['WGName'] = $stemSections[$sectionCount]; + //Get user type, which is after the WG name + if (isset($stemSections[$sectionCount + 1])){ + $group['WGRole'] = $stemSections[$sectionCount + 1]; + } else { + $group['WGRole'] = ''; + } + $appCount = 0; + $appName = ''; + foreach ($stemSections as $stemSection ) { + //Skip first entry + if ($appCount > 0) { + if ($appCount < $sectionCount) { + if ($appCount == 1) { + $appName = $stemSection; + } else { + $appName = $appName . " - " . $stemSection; + } + } + } + $appCount += 1; + } + $group['WGApp'] = $appName; + $workingGroups[] = $group; + unset($groups[$arrayIndex]); + } + } + $arrayIndex += 1; + } + + $finalWorkingGroups = array(); + + foreach ($workingGroups as $workingGroup) { + //Need to set first group in final Working Group array + if (count($finalWorkingGroups) == 0) { + $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + } else { + $foundMatch = false; + foreach ($finalWorkingGroups as &$finalWorkingGroup) { + if($finalWorkingGroup['WGName'] == $workingGroup['WGName']){ + $finalWorkingGroup['Groups'][] = $workingGroup; + $foundMatch = true; + } + } + if (!$foundMatch) { + $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + } + } + } + + $friendlyGroups = $this->getFriendlyName(array_values($groups)); + + //Now need to add the groups back together for one set + foreach($friendlyGroups as $friendlyGroup) { + $finalWorkingGroups[] = $friendlyGroup; + } + + return $finalWorkingGroups; + } + + /** * Determine if result set contains friendly name, if so add as a new attribute in result set * @@ -200,37 +279,30 @@ private function memberOfGroups(array $conditions) { private function getFriendlyName(array $groups) { //NOT fetching attributes now, just using name display name as friendly name, if different from name field +// foreach ($groups as &$group) { +// //$group['friendlyName'] = $group['displayName']; +// $nameSections = explode(':', $group['name']); +// $friendlySections = explode(':', $group['displayName']); +// $numberNameSections = count($nameSections); +// for ($x = 0; $x < $numberNameSections; $x++) { +// if ($nameSections[$x] == $friendlySections[$x]) { +// unset($friendlySections[$x]); +// } else { +// break; +// } +// } +// $group['friendlyName'] = implode(':', $friendlySections); +// if (strlen($group['friendlyName']) == 0) { +// $group['friendlyName'] = $group['name']; +// } +// } + + //TODO - For now just returning Display name as Friendly name, till determined by Bill K. foreach ($groups as &$group) { - //$group['friendlyName'] = $group['displayName']; - $nameSections = explode(':', $group['name']); - $friendlySections = explode(':', $group['displayName']); - $numberNameSections = count($nameSections); - for ($x = 0; $x < $numberNameSections; $x++) { - if ($nameSections[$x] == $friendlySections[$x]) { - unset($friendlySections[$x]); - } - } - $group['friendlyName'] = implode(':', $friendlySections); - if (strlen($group['friendlyName']) == 0) { - $group['friendlyName'] = $group['name']; - } + $group['friendlyName'] = $group['displayName']; } return $groups; - - /* Old Process, keeping in case changes back! - foreach ($groups as &$group) { - $group['friendlyName'] = $group['displayName']; - $attributes = $this->grouperAPI->getGroupAttributes(array('conditions' => array('groupName' => $group['displayName']))); - foreach ($attributes as $attribute) { - if ($attribute['attributeDefNameName'] == $this->friendly) { - if (isset($attribute['wsAttributeAssignValues']['valueSystem'])) { - $group['friendlyName'] = $attribute['wsAttributeAssignValues']['valueSystem']; - } - break; - } - } - }*/ } /** @@ -248,9 +320,8 @@ public function groupDescriptions(string $groupName) { $args['groupName'] = $groupName; $groupDescription = $this->grouperAPI->getGrouperGroupInfo($args); - $groupInfo = $this->getFriendlyName($groupDescription); - return $groupInfo; + return $groupDescription; } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); @@ -325,7 +396,7 @@ public function ownerGroups(array $conditions) { try { $ownGroups = $this->grouperAPI->getOwnedGroups($conditions); - return $this->getFriendlyName($ownGroups); + return $ownGroups; } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); @@ -384,7 +455,7 @@ public function optinGroups(array $conditions) { } //$finalSet = $this->paginateRecords($joinOrLeave, $conditions); - return $this->getFriendlyName($joinOrLeave); + return array_values($joinOrLeave); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); @@ -402,7 +473,7 @@ public function optinEmailGroups(array $conditions) { } } - return $allGroups; + return array_values($allGroups); } /** @@ -632,7 +703,9 @@ public function paginate($conditions) { $resultSet = $this->$method($conditions); - return $this->paginateRecords($resultSet, $conditions); + $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet); + + return $this->paginateRecords($friendlyResults, $conditions); } /** diff --git a/PlantUML/1.puml b/PlantUML/1.puml new file mode 100644 index 0000000..86c136e --- /dev/null +++ b/PlantUML/1.puml @@ -0,0 +1,75 @@ +# Data from API call to get all Groups belong to +@startjson +#highlight "WsGetGroupsLiteResult" / "wsGroups" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "description" +{ + "WsGetGroupsLiteResult": { + "resultMetadata": { + "success": "T", + "resultCode": "SUCCESS" + }, + "wsSubject": { + "...": "..." + }, + "responseMetadata": { + "...": "..." + }, + "wsGroups": [ + { + "extension": "CO_members_active", + "displayName": "app:comanage-provision:CO_members_active", + "description": "Internet2 Collaborations Active Members", + "uuid": "f5dae468b9d9429993992781712c2f83", + "enabled": "T", + "displayExtension": "CO_members_active", + "name": "app:comanage-provision:CO_members_active", + "typeOfGroup": "group", + "idIndex": "11104" + }, + { + "extension": "grouperUiUserData", + "displayName": "etc:grouperUi:grouperUiUserData", + "description": "Internal group for grouper which has ...", + "uuid": "2748e23e51174145a4dc4d9e115c59da", + "enabled": "T", + "displayExtension": "grouperUiUserData", + "name": "etc:grouperUi:grouperUiUserData", + "typeOfGroup": "group", + "idIndex": "10015" + }, + { + "extension": "AdministeredByUniconFolks", + "displayName": "sandbox:UniconTest:Administered By Unicon Folks", + "description": "Description goes here", + "uuid": "0b26aa411a99405b9440be3d0b18dafa", + "enabled": "T", + "displayExtension": "Administered By Unicon Folks", + "name": "sandbox:UniconTest:AdministeredByUniconFolks", + "typeOfGroup": "group", + "idIndex": "18451" + }, + { + "extension": "MembersFromUniconAZ", + "displayName": "sandbox:UniconTest:Members At Unicon in AZ", + "uuid": "7a9f3b9837024a56b12a2a6259d520e0", + "enabled": "T", + "displayExtension": "Members At Unicon in AZ", + "name": "sandbox:UniconTest:MembersFromUniconAZ", + "typeOfGroup": "group", + "idIndex": "18447" + } + ] + } +} +@endjson \ No newline at end of file diff --git a/PlantUML/2.puml b/PlantUML/2.puml new file mode 100644 index 0000000..2cfc608 --- /dev/null +++ b/PlantUML/2.puml @@ -0,0 +1,25 @@ +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Mapping of //My Membership// page to API results + +map "** API Grouper (with example data) => My Membership Page **" as CC { + extension = CO_members_active => NA + displayName = app:comanage-provision:CO_members_active => Name + description = Internet2 Collaborations Active Members => Description + uuid = f5dae468b9d9429993992781712c2f83 => NA + enabled = T => NA + displayExtension = CO_members_active => NA + name = app:comanage-provision:CO_members_active => Name + typeOfGroup = group => NA + idIndex = 11104 => NA +} + +note right of CC + Name Fields are used to determine Friendly Name +end note + +@enduml \ No newline at end of file diff --git a/PlantUML/3.puml b/PlantUML/3.puml new file mode 100644 index 0000000..16c8503 --- /dev/null +++ b/PlantUML/3.puml @@ -0,0 +1,46 @@ +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Current Friendly name process for\nNon Working Groups + +start +:GET "Groups Member Of"; +:Group 1 +{ + "extension": "UniconMemberGroup", + "displayName": "sandbox:UniconTest:Unicon Members Group", + "uuid": "35c1ae4d9529492aac8cb2acb970279b", + "enabled": "T", + "displayExtension": "Unicon Members Group", + "name": "sandbox:UniconTest:UniconMemberGroup", + "typeOfGroup": "group", + "idIndex": "18446" +}; +partition "Compare Displayname and Name Params for Group 1" { +:Data: +**displayName** = "sandbox:UniconTest:Unicon Members Group" +**name** = "sandbox:UniconTest:UniconMemberGroup"; +:**Logic: Compare each Stem section**; + +if (Does "sandbox" == "sandbox"?) then (yes) + if (Does "UniconTest" == "UniconTest"?) then (yes) + if (Does "Unicon Members Group" == "UniconMemberGroup"?) then (yes) + :**FriendlyName** = "sandbox:UniconTest:UniconMemberGroup" + (No variance between **name** and **displayName**); + else (no) + :**FriendlyName** = "Unicon Members Group"; + endif + else (no) + #red:**FriendlyName** = "Unicon Members Group"; + note right: Not possible + endif +else (no) + #red:**FriendlyName** = "UniconTest:Unicon Members Group"; + note: Not possible +endif +stop +} +@enduml \ No newline at end of file diff --git a/PlantUML/4.puml b/PlantUML/4.puml new file mode 100644 index 0000000..37a5912 --- /dev/null +++ b/PlantUML/4.puml @@ -0,0 +1,64 @@ +# Current Friendly name process for Working Groups that is broken +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Current Friendly name process for\na Working Groups that is broken + +start +:GET "Groups Member Of"; +fork +:Group 1 +{ + "extension": "admins", + "displayName": "app:confluence:Axel Working Group:admins", + "description": "Admins of confluence space for working group. Axel's working group for testing", + "uuid": "35eaa34fd2d443e5a66a0a355505f69e", + "enabled": "T", + "displayExtension": "admins", + "name": "app:confluence:AxelWorkingGroup:admins", + "typeOfGroup": "group", + "idIndex": "19010" +}; +fork again +:Group 2 +{ + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group. Axel's working group for testing", + "uuid": "163dc892fa8e484a9262e6e9fa619791", + "enabled": "T", + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users", + "typeOfGroup": "group", + "idIndex": "19011" +}; +end fork +partition "Compare Displayname and Name Params from Group 2" { +:Group 2 Data: +**displayName** = "app:confluence:Axel Working Group:users" +**name** = "app:confluence:AxelWorkingGroup:users"; +:**Logic: Compare each Stem section**; + +if (Does "app" == "app"?) then (yes) + if (Does "confluence" == "confluence"?) then (yes) + if (Does "Axel Working Group" == "AxelWorkingGroup"?) then (yes) + :**FriendlyName** = "app:confluence:AxelWorkingGroup:users" + (No variance between **name** and **displayName**); + else (no) + #red:**FriendlyName** = "Axel Working Group"; + note right: Missing **:users** + endif + else (no) + #red:**FriendlyName** = "Axel Working Group:users"; + note right: Not possible + endif +else (no) + #red:**FriendlyName** = "confluence:Axel Working Group:users"; + note: Not possible +endif +stop +} +@enduml \ No newline at end of file diff --git a/PlantUML/5.puml b/PlantUML/5.puml new file mode 100644 index 0000000..3856ac4 --- /dev/null +++ b/PlantUML/5.puml @@ -0,0 +1,121 @@ +# Removed "enabled"", "typeOfGroup", ""uuid"" and "idIndex" from returned records for brevity +@startjson +{ +"wsGroups": [ + { + "extension": "CO_members_active", + "displayName": "app:comanage-provision:CO_members_active", + "description": "Internet2 Collaborations Active Members", + "displayExtension": "CO_members_active", + "name": "app:comanage-provision:CO_members_active", + "typeOfGroup": "group", + "idIndex": "11104" + }, + { + "extension": "admins", + "displayName": "app:confluence:Axel Working Group:admins", + "description": "Admins of confluence space for working group. Axel's working group for testing", + "displayExtension": "admins", + "name": "app:confluence:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group. Axel's working group for testing", + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "app:confluence:NewWorkingGroupTest1155:admins", + "description": "Admins of confluence space for working group. NewWorkingGroupTest1155", + "displayExtension": "admins", + "name": "app:confluence:NewWorkingGroupTest1155:admins" + }, + { + "extension": "admins", + "displayName": "app:jira:AxelWorkingGroup:admins", + "description": "Users of jira project for working group. Axel's working group for testing", + "displayExtension": "admins", + "name": "app:jira:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "app:jira:AxelWorkingGroup:users", + "description": "Subscribers list receives working group emails. Axel's working group for testing", + "displayExtension": "users", + "name": "app:jira:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "app:jira:NewWorkingGroupTest1155:admins", + "description": "Users of jira project for working group. NewWorkingGroupTest1155", + "displayExtension": "admins", + "name": "app:jira:NewWorkingGroupTest1155:admins" + }, + { + "extension": "owners", + "displayName": "app:sympa:internet2:AxelWorkingGroup:owners", + "description": "Owners list manages the email list for the working group. Axel's working group for testing", + "displayExtension": "owners", + "name": "app:sympa:internet2:AxelWorkingGroup:owners" + }, + { + "extension": "subscribers", + "displayName": "app:sympa:internet2:AxelWorkingGroup:subscribers", + "description": "Subscribers list receives working group emails. Axel's working group for testing", + "displayExtension": "subscribers", + "name": "app:sympa:internet2:AxelWorkingGroup:subscribers" + }, + { + "extension": "owners", + "displayName": "app:sympa:internet2:NewWorkingGroupTest1155:owners", + "description": "Owners list manages the email list for the working group. NewWorkingGroupTest1155", + "displayExtension": "owners", + "name": "app:sympa:internet2:NewWorkingGroupTest1155:owners" + }, + { + "extension": "grouperUiUserData", + "displayName": "etc:grouperUi:grouperUiUserData", + "description": "Internal group for grouper which has user data stored ...", + "displayExtension": "grouperUiUserData", + "name": "etc:grouperUi:grouperUiUserData" + }, + { + "extension": "sysadmingroup", + "displayName": "etc:sysadmingroup", + "description": "system administrators with all privileges", + "displayExtension": "sysadmingroup", + "name": "etc:sysadmingroup" + }, + { + "extension": "admins", + "displayName": "ref:InCommon-collab:AxelWorkingGroup:AxelWorkingGroup admins", + "description": "Admins role means can manage / attest the working group. Axel's working group for testing", + "displayExtension": "AxelWorkingGroup admins", + "name": "ref:incommon-collab:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "ref:InCommon-collab:AxelWorkingGroup:AxelWorkingGroup users", + "description": "Users role means members of the working group with access to collaboration tools. Axel's working group for testing", + "displayExtension": "AxelWorkingGroup users", + "name": "ref:incommon-collab:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "ref:InCommon-collab:NewWorkingGroupTest1155:NewWorkingGroupTest1155 admins", + "description": "Admins role means can manage / attest the working group. NewWorkingGroupTest1155", + "displayExtension": "NewWorkingGroupTest1155 admins", + "name": "ref:incommon-collab:NewWorkingGroupTest1155:admins" + }, + { + "extension": "workinggroupadmins", + "displayName": "ref:workinggroupadmins", + "description": "Being a member of this group enables you to create collaboration groups under ...", + "displayExtension": "workinggroupadmins", + "name": "ref:workinggroupadmins" + } + ] +} +@endjson \ No newline at end of file diff --git a/PlantUML/6.puml b/PlantUML/6.puml new file mode 100644 index 0000000..0999820 --- /dev/null +++ b/PlantUML/6.puml @@ -0,0 +1,27 @@ +# Info taken from https://spaces.at.internet2.edu/display/Grouper/Grouper+custom+template+via+GSH+Internet2+example +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Process groups to verify if part of\na Working Group + +start +:Working Group Stems: +---- +* "app:jira" +* "app:confluence" +* "app:sympa:internet2" +* "app:sympa:incommon" +* "ref:InCommon-collab"; + +partition "For Each Group" { +if (Does "app:jira:AxelWorkingGroup:users" start with any **Working Group Stem**?) then (yes) + :Hold as part of a Working Group; +else (no) + :Next record"; +endif +} +stop +@enduml \ No newline at end of file diff --git a/PlantUML/7.puml b/PlantUML/7.puml new file mode 100644 index 0000000..24616f8 --- /dev/null +++ b/PlantUML/7.puml @@ -0,0 +1,63 @@ +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title With records held as part of\na Working Group + +start +:GET "Groups Member Of"; +fork +:Group 1 +{ + "extension": "admins", + "displayName": "app:confluence:Bill Working Group:admins", + "description": "Admins of confluence space for working group." + "displayExtension": "admins", + "name": "app:confluence:BillWorkingGroup:admins" +}; +fork again +:Group 2 +{ + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group." + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users" +}; +fork again +:Group 3 +{ + "extension": "admins", + "displayName": "app:jira:AxelWorkingGroup:admins", + "description": "Users of jira project for working group." + "displayExtension": "admins", + "name": "app:jira:AxelWorkingGroup:admins" +}; +end fork +partition "Compare Each Group to see if same Working Group" { +:Compare Group 1 and Group 2 +**Group 1 name** = "app:confluence:BillWorkingGroup:admins" +**Group 2 name** = "app:confluence:AxelWorkingGroup:users"; +:Assumption = Last section of name value is **ALWAYS** Members (users, admins) , therefore second to last section is Working Group Name; +if (Does "BillWorkingGroup" == "AxelWorkingGroup"?) then (yes) + :Save to BillWorkingGroup; +endif +:Compare Group 2 and Group 3; +if (Does "AxelWorkingGroup" == "AxelWorkingGroup"?) then (yes) + :Save to AxelWorkingGroup; +endif +} +stop + +:=//My Membership:// +---- +**BillWorkingGroup:** +* Confluence Admins +---- +**Axel Working Group:** +* Confluence Users +* Jira Admins; + +@enduml \ No newline at end of file diff --git a/PlantUML/GroupsBelongTo.puml b/PlantUML/GroupsBelongTo.puml new file mode 100644 index 0000000..c81241a --- /dev/null +++ b/PlantUML/GroupsBelongTo.puml @@ -0,0 +1,219 @@ + +# Removed "enabled"", "typeOfGroup", ""uuid"" and "idIndex" from returned records for brevity +@startjson +{ +"wsGroups": [ + { + "extension": "CO_members_active", + "displayName": "app:comanage-provision:CO_members_active", + "description": "Internet2 Collaborations Active Members", + "displayExtension": "CO_members_active", + "name": "app:comanage-provision:CO_members_active", + "typeOfGroup": "group", + "idIndex": "11104" + }, + { + "extension": "admins", + "displayName": "app:confluence:Axel Working Group:admins", + "description": "Admins of confluence space for working group. Axel's working group for testing", + "displayExtension": "admins", + "name": "app:confluence:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group. Axel's working group for testing", + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "app:confluence:NewWorkingGroupTest1155:admins", + "description": "Admins of confluence space for working group. NewWorkingGroupTest1155", + "displayExtension": "admins", + "name": "app:confluence:NewWorkingGroupTest1155:admins" + }, + { + "extension": "admins", + "displayName": "app:jira:AxelWorkingGroup:admins", + "description": "Users of jira project for working group. Axel's working group for testing", + "displayExtension": "admins", + "name": "app:jira:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "app:jira:AxelWorkingGroup:users", + "description": "Subscribers list receives working group emails. Axel's working group for testing", + "displayExtension": "users", + "name": "app:jira:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "app:jira:NewWorkingGroupTest1155:admins", + "description": "Users of jira project for working group. NewWorkingGroupTest1155", + "displayExtension": "admins", + "name": "app:jira:NewWorkingGroupTest1155:admins" + }, + { + "extension": "owners", + "displayName": "app:sympa:internet2:AxelWorkingGroup:owners", + "description": "Owners list manages the email list for the working group. Axel's working group for testing", + "displayExtension": "owners", + "name": "app:sympa:internet2:AxelWorkingGroup:owners" + }, + { + "extension": "subscribers", + "displayName": "app:sympa:internet2:AxelWorkingGroup:subscribers", + "description": "Subscribers list receives working group emails. Axel's working group for testing", + "displayExtension": "subscribers", + "name": "app:sympa:internet2:AxelWorkingGroup:subscribers" + }, + { + "extension": "owners", + "displayName": "app:sympa:internet2:NewWorkingGroupTest1155:owners", + "description": "Owners list manages the email list for the working group. NewWorkingGroupTest1155", + "displayExtension": "owners", + "name": "app:sympa:internet2:NewWorkingGroupTest1155:owners" + }, + { + "extension": "grouperUiUserData", + "displayName": "etc:grouperUi:grouperUiUserData", + "description": "Internal group for grouper which has user data stored ...", + "displayExtension": "grouperUiUserData", + "name": "etc:grouperUi:grouperUiUserData" + }, + { + "extension": "sysadmingroup", + "displayName": "etc:sysadmingroup", + "description": "system administrators with all privileges", + "displayExtension": "sysadmingroup", + "name": "etc:sysadmingroup" + }, + { + "extension": "admins", + "displayName": "ref:InCommon-collab:AxelWorkingGroup:AxelWorkingGroup admins", + "description": "Admins role means can manage / attest the working group. Axel's working group for testing", + "displayExtension": "AxelWorkingGroup admins", + "name": "ref:incommon-collab:AxelWorkingGroup:admins" + }, + { + "extension": "users", + "displayName": "ref:InCommon-collab:AxelWorkingGroup:AxelWorkingGroup users", + "description": "Users role means members of the working group with access to collaboration tools. Axel's working group for testing", + "displayExtension": "AxelWorkingGroup users", + "name": "ref:incommon-collab:AxelWorkingGroup:users" + }, + { + "extension": "admins", + "displayName": "ref:InCommon-collab:NewWorkingGroupTest1155:NewWorkingGroupTest1155 admins", + "description": "Admins role means can manage / attest the working group. NewWorkingGroupTest1155", + "displayExtension": "NewWorkingGroupTest1155 admins", + "name": "ref:incommon-collab:NewWorkingGroupTest1155:admins" + }, + { + "extension": "workinggroupadmins", + "displayName": "ref:workinggroupadmins", + "description": "Being a member of this group enables you to create collaboration groups under ...", + "displayExtension": "workinggroupadmins", + "name": "ref:workinggroupadmins" + } + ] +} +@endjson + + +============================================================= + +# Info taken from https://spaces.at.internet2.edu/display/Grouper/Grouper+custom+template+via+GSH+Internet2+example +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Process groups to verify if part of\na Working Group + +start +:Working Group Stems: +---- +* "app:jira" +* "app:confluence" +* "app:sympa:internet2" +* "app:sympa:incommon" +* "ref:InCommon-collab"; + +partition "For Each Group" { +if (Does "app:jira:AxelWorkingGroup:users" start with any **Working Group Stem**?) then (yes) + :Hold as part of a Working Group; +else (no) + :Next record"; +endif +} +stop +@enduml + +============================================================= + +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title With records held as part of\na Working Group + +start +:GET "Groups Member Of"; +fork +:Group 1 +{ + "extension": "admins", + "displayName": "app:confluence:Bill Working Group:admins", + "description": "Admins of confluence space for working group." + "displayExtension": "admins", + "name": "app:confluence:BillWorkingGroup:admins" +}; +fork again +:Group 2 +{ + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group." + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users" +}; +fork again +:Group 3 +{ + "extension": "admins", + "displayName": "app:jira:AxelWorkingGroup:admins", + "description": "Users of jira project for working group." + "displayExtension": "admins", + "name": "app:jira:AxelWorkingGroup:admins" +}; +end fork +partition "Compare Each Group to see if same Working Group" { +:Compare Group 1 and Group 2 +**Group 1 name** = "app:confluence:BillWorkingGroup:admins" +**Group 2 name** = "app:confluence:AxelWorkingGroup:users"; +:Assumption = Last section of name value is **ALWAYS** Members (users, admins) , therefore second to last section is Working Group Name; +if (Does "BillWorkingGroup" == "AxelWorkingGroup"?) then (yes) + :Save to BillWorkingGroup; +endif +:Compare Group 2 and Group 3; +if (Does "AxelWorkingGroup" == "AxelWorkingGroup"?) then (yes) + :Save to AxelWorkingGroup; +endif +} +stop + +:=//My Membership:// +---- +**BillWorkingGroup:** +* Confluence Admins +---- +**Axel Working Group:** +* Confluence Users +* Jira Admins; + +@enduml \ No newline at end of file diff --git a/PlantUML/MyMemberProcess.puml b/PlantUML/MyMemberProcess.puml new file mode 100644 index 0000000..211ce24 --- /dev/null +++ b/PlantUML/MyMemberProcess.puml @@ -0,0 +1,219 @@ +# Data from API call to get all Groups belong to +@startjson +#highlight "WsGetGroupsLiteResult" / "wsGroups" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "0" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "1" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "2" / "description" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "name" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "displayName" +#highlight "WsGetGroupsLiteResult" / "wsGroups" / "3" / "description" +{ + "WsGetGroupsLiteResult": { + "resultMetadata": { + "success": "T", + "resultCode": "SUCCESS" + }, + "wsSubject": { + "...": "..." + }, + "responseMetadata": { + "...": "..." + }, + "wsGroups": [ + { + "extension": "CO_members_active", + "displayName": "app:comanage-provision:CO_members_active", + "description": "Internet2 Collaborations Active Members", + "uuid": "f5dae468b9d9429993992781712c2f83", + "enabled": "T", + "displayExtension": "CO_members_active", + "name": "app:comanage-provision:CO_members_active", + "typeOfGroup": "group", + "idIndex": "11104" + }, + { + "extension": "grouperUiUserData", + "displayName": "etc:grouperUi:grouperUiUserData", + "description": "Internal group for grouper which has ...", + "uuid": "2748e23e51174145a4dc4d9e115c59da", + "enabled": "T", + "displayExtension": "grouperUiUserData", + "name": "etc:grouperUi:grouperUiUserData", + "typeOfGroup": "group", + "idIndex": "10015" + }, + { + "extension": "AdministeredByUniconFolks", + "displayName": "sandbox:UniconTest:Administered By Unicon Folks", + "description": "Description goes here", + "uuid": "0b26aa411a99405b9440be3d0b18dafa", + "enabled": "T", + "displayExtension": "Administered By Unicon Folks", + "name": "sandbox:UniconTest:AdministeredByUniconFolks", + "typeOfGroup": "group", + "idIndex": "18451" + }, + { + "extension": "MembersFromUniconAZ", + "displayName": "sandbox:UniconTest:Members At Unicon in AZ", + "uuid": "7a9f3b9837024a56b12a2a6259d520e0", + "enabled": "T", + "displayExtension": "Members At Unicon in AZ", + "name": "sandbox:UniconTest:MembersFromUniconAZ", + "typeOfGroup": "group", + "idIndex": "18447" + } + ] + } +} +@endjson + +============================================================= + +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Mapping of //My Membership// page to API results + +map "** API Grouper (with example data) => My Membership Page **" as CC { + extension = CO_members_active => NA + displayName = app:comanage-provision:CO_members_active => Name + description = Internet2 Collaborations Active Members => Description + uuid = f5dae468b9d9429993992781712c2f83 => NA + enabled = T => NA + displayExtension = CO_members_active => NA + name = app:comanage-provision:CO_members_active => Name + typeOfGroup = group => NA + idIndex = 11104 => NA +} + +note right of CC + Name Fields are used to determine Friendly Name +end note + +@enduml + +============================================================= + +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Current Friendly name process for\nNon Working Groups + +start +:GET "Groups Member Of"; +:Group 1 +{ + "extension": "UniconMemberGroup", + "displayName": "sandbox:UniconTest:Unicon Members Group", + "uuid": "35c1ae4d9529492aac8cb2acb970279b", + "enabled": "T", + "displayExtension": "Unicon Members Group", + "name": "sandbox:UniconTest:UniconMemberGroup", + "typeOfGroup": "group", + "idIndex": "18446" +}; +partition "Compare Displayname and Name Params for Group 1" { +:Data: +**displayName** = "sandbox:UniconTest:Unicon Members Group" +**name** = "sandbox:UniconTest:UniconMemberGroup"; +:**Logic: Compare each Stem section**; + +if (Does "sandbox" == "sandbox"?) then (yes) + if (Does "UniconTest" == "UniconTest"?) then (yes) + if (Does "Unicon Members Group" == "UniconMemberGroup"?) then (yes) + :**FriendlyName** = "sandbox:UniconTest:UniconMemberGroup" + (No variance between **name** and **displayName**); + else (no) + :**FriendlyName** = "Unicon Members Group"; + endif + else (no) + #red:**FriendlyName** = "Unicon Members Group"; + note right: Not possible + endif +else (no) + #red:**FriendlyName** = "UniconTest:Unicon Members Group"; + note: Not possible +endif +stop +} +@enduml + +============================================================= + +# Current Friendly name process for Working Groups that is broken +@startuml +skinparam titleBorderRoundCorner 15 +skinparam titleBorderThickness 2 +skinparam titleBorderColor red +skinparam titleBackgroundColor Aqua-CadetBlue + +title Current Friendly name process for\na Working Groups that is broken + +start +:GET "Groups Member Of"; +fork +:Group 1 +{ + "extension": "admins", + "displayName": "app:confluence:Axel Working Group:admins", + "description": "Admins of confluence space for working group. Axel's working group for testing", + "uuid": "35eaa34fd2d443e5a66a0a355505f69e", + "enabled": "T", + "displayExtension": "admins", + "name": "app:confluence:AxelWorkingGroup:admins", + "typeOfGroup": "group", + "idIndex": "19010" +}; +fork again +:Group 2 +{ + "extension": "users", + "displayName": "app:confluence:Axel Working Group:users", + "description": "Users of confluence space for working group. Axel's working group for testing", + "uuid": "163dc892fa8e484a9262e6e9fa619791", + "enabled": "T", + "displayExtension": "users", + "name": "app:confluence:AxelWorkingGroup:users", + "typeOfGroup": "group", + "idIndex": "19011" +}; +end fork +partition "Compare Displayname and Name Params from Group 2" { +:Group 2 Data: +**displayName** = "app:confluence:Axel Working Group:users" +**name** = "app:confluence:AxelWorkingGroup:users"; +:**Logic: Compare each Stem section**; + +if (Does "app" == "app"?) then (yes) + if (Does "confluence" == "confluence"?) then (yes) + if (Does "Axel Working Group" == "AxelWorkingGroup"?) then (yes) + :**FriendlyName** = "app:confluence:AxelWorkingGroup:users" + (No variance between **name** and **displayName**); + else (no) + #red:**FriendlyName** = "Axel Working Group"; + note right: Missing **:users** + endif + else (no) + #red:**FriendlyName** = "Axel Working Group:users"; + note right: Not possible + endif +else (no) + #red:**FriendlyName** = "confluence:Axel Working Group:users"; + note: Not possible +endif +stop +} +@enduml diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 734a40c..9074a6d 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -2,7 +2,7 @@ Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> - 0) : ?> + 0 || count($wgmemberships) > 0) : ?>
element("pagination", array( 'goto' => false, @@ -20,7 +20,7 @@ - $group) : ?> + $group) : ?> - + ) ?>" title=""> + element('GrouperLite.Components/optAction', array( 'member' => $group['optOut'], @@ -40,6 +40,36 @@ + + + + + + $group) : ?> + + + + + + + +
+ element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> +
+ + + element("pagination", array( @@ -50,7 +80,7 @@ )); ?>
- +

diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index e17a2c7..d275e14 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -2,55 +2,88 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?> element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?> - 0) : ?> -
- element("pagination", array( + 0 || count($wgoptins) > 0) : ?> +
+ element("pagination", array( 'goto' => false, 'limit' => false, 'numbers' => false, 'counter' => true, 'class' => 'counter' - )); ?> - - + )); ?> +
+ - - - $group) : ?> + + + $group) : ?> - + array( + 'controller' => 'grouper_groups', + 'action' => 'groupinfo', + '?' => array('groupname' => urlencode($group['name'])) + ) + ) ?>" title=""> + + + + + + + - -
- element('GrouperLite.Components/optAction', array( - 'member' => $group['member'], - 'action' => 'joingroup', - 'group' => $group['name'], - 'idx' => $key - )); ?> + element('GrouperLite.Components/optAction', array( + 'member' => $group['member'], + 'action' => 'joingroup', + 'group' => $group['name'], + 'idx' => $key + )); ?> +
+ + + $group) : ?> + + + + + + + +
+ + element('GrouperLite.Components/optAction', array( + 'member' => $group['member'], + 'action' => 'joingroup', + 'group' => $group['name'], + 'idx' => $key + )); ?> +
- element("pagination", array( + + + element("pagination", array( 'goto' => false, 'limit' => true, 'numbers' => true, 'counter' => false - )); ?> -
+ )); ?> +
- +

diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 0654d39..05b7892 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -3,37 +3,39 @@ element('Components/navigation-groups', array('active' => 'groupowner')); ?> element('Components/search', array('active' => 'groupowner')); ?> - 0) : ?> + 0 || count($wgowners) > 0) : ?>
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> + element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> - - - - - - + + + + + + - - - - - - + + + + - - + + + + + + + +
+ +
+ -
+ + + $group) : ?> + + + + + + + + +
+ + + + + +
+
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?>
- +

From 36f63dab7341d31c6e4acd0fdb3717ef44d64ebf Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 7 Jul 2021 09:26:01 -0700 Subject: [PATCH 017/143] Updated layout --- Lib/lang.php | 1 + View/GrouperGroups/groupmember.ctp | 69 +++++----- View/GrouperGroups/groupoptin.ctp | 172 +++++++++++++------------ View/GrouperGroups/groupowner.ctp | 196 +++++++++++++++-------------- 4 files changed, 237 insertions(+), 201 deletions(-) diff --git a/Lib/lang.php b/Lib/lang.php index 0eaeaea..3071470 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -52,6 +52,7 @@ 'pl.grouperlite.table.name' => 'Name', 'pl.grouperlite.table.description' => 'Description', + 'pl.grouperlite.table.role' => 'Role', 'pl.grouperlite.table.status' => 'Status', 'pl.grouperlite.table.action' => 'Action', 'pl.grouperlite.table.open' => 'Access', diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 9074a6d..6c51d8d 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -2,6 +2,15 @@ Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> + 'pl.grouperlite.table.name', + 'role' => 'pl.grouperlite.table.role', + 'description' => 'pl.grouperlite.table.description', + 'action' => 'pl.grouperlite.table.action' +]; +$numColumns = count($columns); +?> 0 || count($wgmemberships) > 0) : ?>
element("pagination", array( @@ -14,12 +23,15 @@ - - - + $label) : ?> + + + + + $group) : ?> + + + - + $group) : ?> + + + + + + +
Ad-hoc groups
element('GrouperLite.Components/optAction', array( @@ -40,35 +53,35 @@
- - - $group) : ?> - - - - - - - -
- element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'idx' => $key - )) : ''; ?> -
+
+
+ element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> +
diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index d275e14..c7a6f36 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -2,89 +2,101 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?> element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?> + 'pl.grouperlite.table.name', + 'role' => 'pl.grouperlite.table.role', + 'description' => 'pl.grouperlite.table.description', + 'action' => 'pl.grouperlite.table.action' +]; +$numColumns = count($columns); +?> 0 || count($wgoptins) > 0) : ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - +
+ element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
+ + + $label) : ?> + + + + + + + + + $group) : ?> + + + + + + + + + + + + + + $group) : ?> - - - + + + + - - - $group) : ?> - - - - - - - - - - - - -
Ad-hoc groups
+ + element('GrouperLite.Components/optAction', array( + 'member' => $group['member'], + 'action' => 'joingroup', + 'group' => $group['name'], + 'idx' => $key + )); ?> +
+ +
+ + element('GrouperLite.Components/optAction', array( + 'member' => $group['member'], + 'action' => 'joingroup', + 'group' => $group['name'], + 'idx' => $key + )); ?> +
- - element('GrouperLite.Components/optAction', array( - 'member' => $group['member'], - 'action' => 'joingroup', - 'group' => $group['name'], - 'idx' => $key - )); ?> -
- - - $group) : ?> - - - - - - - -
- - element('GrouperLite.Components/optAction', array( - 'member' => $group['member'], - 'action' => 'joingroup', - 'group' => $group['name'], - 'idx' => $key - )); ?> -
-
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
+ + + + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?> +
-
-

-
+
+

+
\ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 05b7892..9277e68 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -2,102 +2,112 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-presided')); ?> element('Components/navigation-groups', array('active' => 'groupowner')); ?> element('Components/search', array('active' => 'groupowner')); ?> - + 'pl.grouperlite.table.name', + 'role' => 'pl.grouperlite.table.role', + 'description' => 'pl.grouperlite.table.description', + 'status' => 'pl.grouperlite.table.status', + 'action' => 'pl.grouperlite.table.action' +]; +$numColumns = count($columns); +?> 0 || count($wgowners) > 0) : ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - +
+ element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
+ + + $label) : ?> + + + + + + + + + + + + + + + + + + + + + + + + $group) : ?> - - - - + + + + + - - - - - - - - - - - - - - - - -
Ad-hoc groups
+ + + + + +
+ +
+ + + + + +
- - - - - -
- - - $group) : ?> - - - - - - - - -
- - - - - -
-
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
+ + + + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?> +
-
-

-
+
+

+
\ No newline at end of file From 4f58bf93824f819e20b08157aabd225d8fbe9bc5 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 7 Jul 2021 09:57:39 -0700 Subject: [PATCH 018/143] Updated headings --- View/GrouperGroups/groupmember.ctp | 36 ++++++++++++++++-------------- View/GrouperGroups/groupoptin.ctp | 34 +++++++++++++++------------- View/GrouperGroups/groupowner.ctp | 34 +++++++++++++++------------- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 6c51d8d..62bb7e9 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -30,17 +30,19 @@ $numColumns = count($columns); - Ad-hoc groups + +

Ad-hoc groups

+ $group) : ?> - + @@ -58,18 +60,18 @@ $numColumns = count($columns); - +

$group) : ?> - - + + diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index c7a6f36..0de3dfc 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -30,17 +30,19 @@ $numColumns = count($columns); - Ad-hoc groups + +

Ad-hoc groups

+ $group) : ?> - + @@ -59,18 +61,18 @@ $numColumns = count($columns); - +

$group) : ?> - + diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 9277e68..60a1f41 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -31,17 +31,19 @@ $numColumns = count($columns); - Ad-hoc groups + +

Ad-hoc groups + - + @@ -65,18 +67,18 @@ $numColumns = count($columns); - +

$group) : ?> - + From 541df6147f48f07087c506aa57c614f7102bac58 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 7 Jul 2021 10:19:44 -0700 Subject: [PATCH 019/143] Fixed button color --- webroot/css/co-grouper-base.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webroot/css/co-grouper-base.css b/webroot/css/co-grouper-base.css index 8080b7f..3d77f57 100644 --- a/webroot/css/co-grouper-base.css +++ b/webroot/css/co-grouper-base.css @@ -24,5 +24,10 @@ background-color: var(--danger); border-color: var(--danger); color: white; + filter: grayscale(20%); box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12); +} + +.grouper .btn.btn-danger.btn-grouper:hover { + background-color: var(--danger); } \ No newline at end of file From 6bde64dc3eacf1ecd365d136b96b49c5f9e5bb7c Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 7 Jul 2021 11:33:34 -0700 Subject: [PATCH 020/143] updated css --- webroot/css/co-grouper-base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webroot/css/co-grouper-base.css b/webroot/css/co-grouper-base.css index 3d77f57..bdd0d9c 100644 --- a/webroot/css/co-grouper-base.css +++ b/webroot/css/co-grouper-base.css @@ -29,5 +29,5 @@ } .grouper .btn.btn-danger.btn-grouper:hover { - background-color: var(--danger); + filter: none; } \ No newline at end of file From a554711b760d599d70f90e9b0c1a3e2ba31bbe80 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 7 Jul 2021 11:49:15 -0700 Subject: [PATCH 021/143] Fixed styles --- View/Elements/Components/optAction.ctp | 8 ++++---- View/GrouperGroups/groupmember.ctp | 10 +++++----- View/GrouperGroups/groupoptin.ctp | 8 ++++---- View/GrouperGroups/groupowner.ctp | 8 ++++---- webroot/css/co-grouper-base.css | 7 +------ 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/View/Elements/Components/optAction.ctp b/View/Elements/Components/optAction.ctp index cf6504a..e9a818f 100644 --- a/View/Elements/Components/optAction.ctp +++ b/View/Elements/Components/optAction.ctp @@ -3,9 +3,9 @@ 'class' => 'd-flex justify-content-center', 'id' => 'join-group.' . $idx )); ?> -Form->hidden('GroupName', array('default' => $group, 'id' => 'groupName.'.$idx)); ?> - Form->end(); ?> \ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 62bb7e9..7b5c825 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -31,12 +31,12 @@ $numColumns = count($columns); -

Ad-hoc groups

+

Ad-hoc groups

$group) : ?> - "> -

+

$group) : ?> - -
"> -

Ad-hoc groups

+

Ad-hoc groups

$group) : ?> -
"> -

+

$group) : ?> -
"> -

Ad-hoc groups +

Ad-hoc groups - "> -

+

$group) : ?> -
Ad-hoc groups + + + + You are not a manager of any ad-hoc groups. + + + - + */ ?> @@ -89,10 +96,10 @@ $numColumns = count($columns);   - + */ ?> From ce8b675e4dba90239011259ae260bfa8efef817c Mon Sep 17 00:00:00 2001 From: axman Date: Fri, 16 Jul 2021 12:06:55 -0700 Subject: [PATCH 023/143] changes for leave/join buttons at WG level --- Controller/GrouperGroupsController.php | 126 ++++++++++++------------- Model/GrouperGroup.php | 6 +- 2 files changed, 65 insertions(+), 67 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 5257ba8..5e2a01c 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -195,18 +195,10 @@ public function groupOwner() { $data = $this->Paginator->paginate('GrouperGroup', $scope); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data); - $this->set('groupsowners', $notWGData); - $this->set('wgowners', $wgData); + $this->set('groupsowners', $finalData['adHocGroups']); + $this->set('wgowners', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); @@ -221,18 +213,10 @@ public function groupOwner() { $data = $this->Paginator->paginate('GrouperGroup', $scope); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data); - $this->set('groupsowners', $notWGData); - $this->set('wgowners', $wgData); + $this->set('groupsowners', $finalData['adHocGroups']); + $this->set('wgowners', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -248,6 +232,48 @@ public function groupOwner() { $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); } + /** + * Breakout Working Groups from AdHoc Groups for display purposes in UI. + * + * @param array $recordSet + * @return array[] + * + */ + public function breakoutGroups(array $recordSet, $type='basic') { + + $wgData = array(); + $notWGData = array(); + foreach($recordSet as $record) { + if(isset($record['WGName'])) { + $wgData[] = $record; + } else { + $notWGData[] = $record; + } + } + + if ($type == 'basic') { + //Need to surface Optout flag to top level of a Working Group + foreach($wgData as &$wgRec) { + foreach($wgRec['Groups'] as $rec){ + if(isset($rec['optOut'])) { + $wgRec['optOut'] = true; + $wgRec['workingGroupId'] = $rec['name']; + } + } + } + } elseif ($type == 'optin') { + foreach($wgData as &$wgRec) { + $wgRec['workingGroupId'] = $wgRec['Groups'][0]['name']; + } + } + + + return array( + 'adHocGroups' => $notWGData, + 'workingGroups' => $wgData + ); + } + /** * Returns all Groups that the User is a member of in Grouper * This includes self-joined Optin Groups, as well as required Groups User cannot leave @@ -275,18 +301,10 @@ public function groupMember() { $data = $this->Paginator->paginate('GrouperGroup', $scope); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data); - $this->set('groupmemberships', $notWGData); - $this->set('wgmemberships', $wgData); + $this->set('groupmemberships', $finalData['adHocGroups']); + $this->set('wgmemberships', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); @@ -303,18 +321,10 @@ public function groupMember() { $data = $this->Paginator->paginate('GrouperGroup', $scope); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data); - $this->set('groupmemberships', $notWGData); - $this->set('wgmemberships', $wgData); + $this->set('groupmemberships', $finalData['adHocGroups']); + $this->set('wgmemberships', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -355,18 +365,10 @@ public function groupOptin() { $data = $this->Paginator->paginate('GrouperGroup', $scope); //$this->set('groupoptin', $data); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data, 'optin'); - $this->set('groupoptins', $notWGData); - $this->set('wgoptins', $wgData); + $this->set('groupoptins', $finalData['adHocGroups']); + $this->set('wgoptins', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . 'Search: ' . var_export($e->getMessage(), true)); @@ -384,18 +386,10 @@ public function groupOptin() { $data = $this->Paginator->paginate('GrouperGroup', $scope); //$this->set('groupoptin', $data); - $wgData = array(); - $notWGData = array(); - foreach($data as $group) { - if(isset($group['WGName'])) { - $wgData[] = $group; - } else { - $notWGData[] = $group; - } - } + $finalData = $this->breakoutGroups($data,'optin'); - $this->set('groupoptins', $notWGData); - $this->set('wgoptins', $wgData); + $this->set('groupoptins', $finalData['adHocGroups']); + $this->set('wgoptins', $finalData['workingGroups']); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 4e12b1c..e1be79f 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -231,7 +231,11 @@ private function getFriendlyWorkingGroupName(array $groups) { $appCount += 1; } $group['WGApp'] = $appName; - $workingGroups[] = $group; + //TODO - FOR DISPLAY PURPOSE + if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owners') { + $workingGroups[] = $group; + } + //$workingGroups[] = $group; unset($groups[$arrayIndex]); } } From 9d46f36b99c80fc3e8b376a3a67bf6a713ac4d8e Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Fri, 23 Jul 2021 09:44:24 -0700 Subject: [PATCH 024/143] Updated uii --- View/Elements/Components/optAction.ctp | 2 +- View/Elements/Components/search.ctp | 17 -------- View/Elements/base-styles.ctp | 2 +- View/GrouperGroups/base.ctp | 13 +++++- View/GrouperGroups/groupmember.ctp | 56 +++++++++++++++++--------- View/GrouperGroups/groupoptin.ctp | 41 +++++++++++++------ View/GrouperGroups/groupowner.ctp | 34 ++++++++++------ webroot/css/co-grouper-base.css | 2 +- webroot/css/co-grouper-plugin.css | 29 +++++++++++-- 9 files changed, 127 insertions(+), 69 deletions(-) diff --git a/View/Elements/Components/optAction.ctp b/View/Elements/Components/optAction.ctp index e9a818f..e2bd7aa 100644 --- a/View/Elements/Components/optAction.ctp +++ b/View/Elements/Components/optAction.ctp @@ -4,7 +4,7 @@ 'id' => 'join-group.' . $idx )); ?> Form->hidden('GroupName', array('default' => $group, 'id' => 'groupName.' . $idx)); ?> - diff --git a/View/Elements/Components/search.ctp b/View/Elements/Components/search.ctp index 6375a3c..c456412 100644 --- a/View/Elements/Components/search.ctp +++ b/View/Elements/Components/search.ctp @@ -1,20 +1,3 @@ - Form->create(false, array( 'url' => array('controller' => 'grouper_groups', 'action' => $active), 'class' => 'search mb-4' diff --git a/View/Elements/base-styles.ctp b/View/Elements/base-styles.ctp index d000702..b7a6607 100644 --- a/View/Elements/base-styles.ctp +++ b/View/Elements/base-styles.ctp @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/View/GrouperGroups/groupinfo.ctp b/View/GrouperGroups/groupinfo.ctp index d8695bd..1fd387b 100644 --- a/View/GrouperGroups/groupinfo.ctp +++ b/View/GrouperGroups/groupinfo.ctp @@ -13,13 +13,7 @@ $attrUrlBase = $baseUrl . $path . $attrOperation;
@@ -48,24 +42,3 @@ $attrUrlBase = $baseUrl . $path . $attrOperation;
- - - - \ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 735dab8..80622b6 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -60,12 +60,21 @@ $numColumns = count($columns); - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'idx' => $key - )) : ''; ?> + + element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> + + + +   + + + + @@ -91,12 +100,32 @@ $numColumns = count($columns); - element('GrouperLite.Components/optAction', array( - 'member' => $wggroup['optOut'], - 'action' => 'leavegroup', - 'group' => $wggroup['workingGroupId'], - 'idx' => $key - )) : ''; ?> + + element('GrouperLite.Components/optAction', array( + 'member' => $wggroup['optOut'], + 'action' => 'leavegroup', + 'group' => $wggroup['workingGroupId'], + 'idx' => $key + )) : ''; ?> + + + + +   + + + + $group) : ?> @@ -139,4 +168,5 @@ $numColumns = count($columns);

- \ No newline at end of file + +element('Components/subscriberList', array('subscribers' => $groupergroupssubscribers)); ?> \ No newline at end of file From 7d03f556a8a05c15d07d69ecbd623ae62901860a Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 27 Sep 2021 10:18:36 -0700 Subject: [PATCH 042/143] changes for member list view --- Controller/GrouperGroupsController.php | 36 +++++++++++++++++++-- View/Elements/Components/subscriberList.ctp | 3 +- View/GrouperGroups/groupmember.ctp | 30 ++++++++--------- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 594f53b..6f24368 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -37,7 +37,7 @@ class GrouperGroupsController extends GrouperLiteAppController { public $helpers = array('Html', 'Form', 'Flash'); - public $components = array('Flash', 'Paginator'); + public $components = array('Flash', 'Paginator', 'RequestHandler'); public $name = 'GrouperGroups'; @@ -168,6 +168,36 @@ public function membersInGroup() { return $details; } + + /** + * Show all members of group in Grouper Group detail page + * Called from method GroupInfo + * + */ + public function groupSubscribers() { + $groupName = urldecode($this->request->query['groupname']); + + if ($this->request->is('ajax')) { + $ajax = true; + } + + //Set initial + $scope = [ + 'groupName' => 'ref:incommon-collab:' . $groupName . ':users' + ]; + + try { + $subscribers = $this->GrouperGroup->membersInGroup($scope); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); + + $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); + } + + $this->set(compact('subscribers')); + $this->set('_serialize', 'subscribers'); + } /** @@ -294,6 +324,7 @@ public function groupMember() { return; } } + $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); } @@ -521,9 +552,10 @@ function isAuthorized() { $p['index'] = true; $p['groupinfo'] = true; - $p['membersInGroup'] = true; + $p['membersingroup'] = true; $p['groupowner'] = true; $p['groupmember'] = true; + $p['groupSubscribers'] = true; $p['groupoptin'] = true; $p['emaillistsoptin'] = true; $p['emaillistsmember'] = true; diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index 83f92ad..e1fa91b 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -18,6 +18,7 @@ -element('Components/subscriberList', array('subscribers' => $subscribers)); ?> \ No newline at end of file +element('Components/subscriberList'); ?> \ No newline at end of file From be89637650356eba48b92321883f907160f71b12 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 27 Sep 2021 12:54:41 -0700 Subject: [PATCH 044/143] Fixed modal --- View/GrouperGroups/groupmember.ctp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index eb5d5d2..a58ca82 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -111,20 +111,20 @@ $numColumns = count($columns); data-id=""> - - - - - - - + + + +   + + +
From eab560fb3508a1268f2c9b67c42e9caa0885f8c5 Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 27 Sep 2021 13:56:46 -0700 Subject: [PATCH 045/143] changes for goto Grouper button --- Controller/GrouperGroupsController.php | 6 ++++-- View/GrouperGroups/groupmember.ctp | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 6f24368..f480446 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -738,9 +738,10 @@ private function breakoutGroups(array $recordSet, $type = 'basic') { foreach ($wgRec['Groups'] as $rec) { if (isset($rec['optOut'])) { $wgRec['optOut'] = true; - $wgRec['workingGroupId'] = $rec['name']; - $wgRec['workingDesc'] = $this->hackDescription($rec['description']); } + $wgRec['workingGroupId'] = $rec['name']; + $wgRec['workingGroupUUID'] = $rec['uuid']; + $wgRec['workingDesc'] = $this->hackDescription($rec['description']); //Capturing record for incommon-collab since deleting a few lines below. if ($rec['WGApp'] == 'incommon-collab') { $recToDelete = $subCount; @@ -758,6 +759,7 @@ private function breakoutGroups(array $recordSet, $type = 'basic') { //Working Groups that will show up on the Optin Page foreach ($wgData as &$wgRec) { $wgRec['workingGroupId'] = $wgRec['Groups'][0]['name']; + $wgRec['workingGroupUUID'] = $wgRec['Groups'][0]['uuid']; $wgRec['workingDesc'] = $this->hackDescription($wgRec['Groups'][0]['description']); unset($wgRec['Groups']); } diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index a58ca82..1f2077a 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -69,7 +69,15 @@ $numColumns = count($columns); )) : ''; ?> - + +   @@ -120,7 +128,7 @@ $numColumns = count($columns); $attrOperation = '?operation=UiV2AttributeDefName.viewAttributeDefName&attributeDefNameId='; $attrUrlBase = $baseUrl . $path . $attrOperation; ?> - +   From a88a1cb1fec68baf510a86620a767b7e49971ada Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 27 Sep 2021 14:45:47 -0700 Subject: [PATCH 046/143] Added buttons to groups I manage page --- View/GrouperGroups/groupmember.ctp | 22 +++++------ View/GrouperGroups/groupowner.ctp | 63 ++++++++++++++++++++++++------ 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 1f2077a..00396cd 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -67,16 +67,17 @@ $numColumns = count($columns); 'group' => $group['name'], 'idx' => $key )) : ''; ?> - + - +   @@ -115,8 +116,7 @@ $numColumns = count($columns); 'group' => $wggroup['workingGroupId'], 'idx' => $key )) : ''; ?> - diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 3a7d62e..9b1f66f 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -63,15 +63,34 @@ $numColumns = count($columns); - - - -   - - */ ?> + element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> + + + + +   + + + @@ -106,15 +125,32 @@ $numColumns = count($columns); - - - -   - - */ ?> + element('GrouperLite.Components/optAction', array( + 'member' => $group['optOut'], + 'action' => 'leavegroup', + 'group' => $group['name'], + 'idx' => $key + )) : ''; ?> + + + + +   + + + @@ -134,4 +170,5 @@ $numColumns = count($columns);

- \ No newline at end of file + +element('Components/subscriberList'); ?> \ No newline at end of file From 05dc3ca1424e5984d34e5b1c078f14ab134225b9 Mon Sep 17 00:00:00 2001 From: axman Date: Mon, 27 Sep 2021 15:02:28 -0700 Subject: [PATCH 047/143] fix member bug on admin page --- Controller/GrouperGroupsController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index f480446..1a03e42 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -181,9 +181,16 @@ public function groupSubscribers() { $ajax = true; } + //Need to see if coming from AdHoc or from a WG (Working Group) + if (strpos($groupName, ':') === false ) { + $groupNameFormatted = 'ref:incommon-collab:' . $groupName . ':users'; + } else { + $groupNameFormatted = $groupName; + } + //Set initial $scope = [ - 'groupName' => 'ref:incommon-collab:' . $groupName . ':users' + 'groupName' => $groupNameFormatted ]; try { @@ -258,6 +265,7 @@ public function groupOwner() { } } + $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); } From f29ba76347b4d97ea364bddfdce07dd79cd2fed4 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 29 Sep 2021 09:50:51 -0700 Subject: [PATCH 048/143] Fixed group admin page --- View/GrouperGroups/groupowner.ctp | 43 ++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 9b1f66f..918fa6e 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -37,7 +37,10 @@ $numColumns = count($columns); -

Ad-hoc groups + @@ -48,7 +51,7 @@ $numColumns = count($columns); - + -

Working groups

+ - + - @@ -155,6 +161,31 @@ $numColumns = count($columns); + $group) : ?> + + + + + + + + + + + + + + + + + + From 36576b5f8eb876b2b251707cc8bd4c68302ccc6f Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 29 Sep 2021 09:58:24 -0700 Subject: [PATCH 049/143] removed links --- View/GrouperGroups/groupmember.ctp | 22 +++------------------- View/GrouperGroups/groupoptin.ctp | 8 +------- View/GrouperGroups/groupowner.ctp | 29 +++-------------------------- 3 files changed, 7 insertions(+), 52 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 00396cd..0bdcb07 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -45,15 +45,7 @@ $numColumns = count($columns); $group) : ?> - - - + — @@ -67,8 +59,7 @@ $numColumns = count($columns); 'group' => $group['name'], 'idx' => $key )) : ''; ?> - + $group) : ?> - - + diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 25151da..85cb5a2 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -44,13 +44,7 @@ $numColumns = count($columns); $group) : ?> - + diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 918fa6e..abeced4 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -52,14 +52,7 @@ $numColumns = count($columns); - - + @@ -119,14 +112,7 @@ $numColumns = count($columns); $group) : ?> - - + @@ -163,16 +149,7 @@ $numColumns = count($columns); $group) : ?> - - - - + From 0e4fbdd747d5c4db09cebfd7b16b5d4d684b2e1c Mon Sep 17 00:00:00 2001 From: axman Date: Thu, 30 Sep 2021 12:32:30 -0700 Subject: [PATCH 050/143] fixing bugs --- Controller/GrouperGroupsController.php | 6 +- Model/GrouperGroup.php | 163 ++++++++++++++++--------- 2 files changed, 109 insertions(+), 60 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 1a03e42..c02afac 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -114,8 +114,6 @@ public function index() { public function groupInfo() { $name = urldecode($this->request->query['groupname']); - $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); - $this->set('title', _txt('pl.grouperlite.title.groupinfo')); try { @@ -139,6 +137,7 @@ public function groupInfo() { $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); } + $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); } @@ -752,11 +751,10 @@ private function breakoutGroups(array $recordSet, $type = 'basic') { $wgRec['workingDesc'] = $this->hackDescription($rec['description']); //Capturing record for incommon-collab since deleting a few lines below. if ($rec['WGApp'] == 'incommon-collab') { - $recToDelete = $subCount; if ($type == 'basic') { //Removing record with stem of 'incommon-collab' since displaying on groups Member page, // will show on Admin page - unset($wgRec['Groups'][$recToDelete]); + unset($wgRec['Groups'][$subCount]); } } $subCount += 1; diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index dd22c00..86f5e41 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -47,7 +47,6 @@ class GrouperGroup extends GrouperLiteAppModel /** @var string Group whose members can create Groups via Template process */ private $templateCreationGroup = 'ref:workinggroupadmins'; - private $wgStemsTopLevel = array( 'ref:incommon-collab' ); @@ -61,9 +60,8 @@ class GrouperGroup extends GrouperLiteAppModel 'ref:incommon-collab' ); - private $emailStem ='app:sympa'; - - + //Stem for email groups, only email groups using this stem are viewable + private $emailStem = 'app:sympa'; // Current listing of stems that are allowed to be viewed in Comanage as AdHoc groups private $stemsAdHocAllowed = array( @@ -109,7 +107,6 @@ public function isUserOwner(string $userId) { } } - /** * Used to instantiate API class * @@ -124,18 +121,33 @@ private function initApi() { } } + /** + * Listing of members in an email group + * + * @param array $conditions Listing of conditions for display of records, including UserId + * @return array List of members that belong to email group + * @throws GrouperLiteException + * + */ public function filteredMemberOfEmails(array $conditions) { + $this->initApi(); - $memberOfEmails = $this->filteredMemberOfGroups($conditions); + try { + $memberOfEmails = $this->filteredMemberOfGroups($conditions); - // Strip out all Groups that are not in app:sympa Stem/Directory - foreach ($memberOfEmails as $key => $value) { - if (strpos(strtolower($value['name']), $this->emailStem) === false) { - unset($memberOfEmails[$key]); + // Strip out all Groups that are not in app:sympa Stem/Directory + foreach ($memberOfEmails as $key => $value) { + if (strpos(strtolower($value['name']), $this->emailStem) === false) { + unset($memberOfEmails[$key]); + } } + return array_values($memberOfEmails); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; } - return array_values($memberOfEmails); } /** @@ -201,7 +213,7 @@ private function memberOfGroups(array $conditions) { * Gets the Grouper Groups params and values as well as its associated attributes. * * @param string $groupName Name of Group, do not confuse with DisplayName field! - * @return array An set of attributes associated to a specific Grouper Group + * @return array A set of attributes associated to a specific Grouper Group * @throws GrouperLiteException */ public function groupDescriptions(string $groupName) { @@ -328,17 +340,34 @@ public function membersInGroup(array $conditions) { } } + /** + * List of Email Groups a user can opt into. + * + * @param array $conditions Listing of conditions for display of records, including UserId + * @return array Listing of Optin email groups available in Groupe + * @throws GrouperLiteException Captured in Controller + * + */ public function optinEmailGroups(array $conditions) { - $allGroups = $this->optinGroups($conditions); + $this->initApi(); + + try { + $allGroups = $this->optinGroups($conditions); - // Strip out all Groups that are not in Sympa Stem/Directory - foreach ($allGroups as $key => $value) { - if (strpos($value['name'], $this->emailStem) === false) { - unset($allGroups[$key]); + // Strip out all Groups that are not in Sympa Stem/Directory + foreach ($allGroups as $key => $value) { + if (strpos($value['name'], $this->emailStem) === false) { + unset($allGroups[$key]); + } } + + return array_values($allGroups); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; } - return array_values($allGroups); } /** @@ -598,23 +627,64 @@ public function getSearchedGroups(array $conditions) { * * @param array $conditions Listing of conditions for display of records with pagination * @return array Records requested by user with pagination support + * @throws Exception Captured in Controller * */ public function paginate($conditions) { + try { + //Pull out the method that should be run. + $method = $conditions['method']; - //Pull out the method that should be run. - $method = $conditions['method']; + $resultSet = $this->$method($conditions); - $resultSet = $this->$method($conditions); + if (isset($conditions['emailonly']) && $conditions['emailonly']) { + if ($method == 'getSearchedGroups' || $method == 'filteredMemberOfEmails') { + $friendlyResults = $this->getFriendlyEmailName($resultSet, 'member'); + } else { + $friendlyResults = $this->getFriendlyEmailName($resultSet, ''); + } - if (isset($conditions['emailonly']) && $conditions['emailonly']) { - $friendlyResults = $this->getFriendlyEmailName($resultSet); - } else { - $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet); + } else { + if ($method == 'getSearchedGroups' || $method == 'filteredMemberOfGroups') { + $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, 'member'); + } else { + $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, ''); + } + } + + return $this->paginateRecords($friendlyResults, $conditions); + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; } + } + + private function getFriendlyEmailName(array $groups, $method) { - return $this->paginateRecords($friendlyResults, $conditions); + $arrayIndex = 0; + foreach ($groups as &$group) { + $appName = ''; + if ($method == 'member') { + if ($group['extension'] == 'admins' || $group['extension'] == 'owners') { + unset($groups[$arrayIndex]); + } + } + $stems = explode(':', $group['name']); + $sectionCount = count($stems) - 2; + $groupName = $stems[$sectionCount]; + $domain = $stems[2]; + if (strtolower($domain) == 'incommon') { + $address = $groupName . '@lists.incommon.org'; + } elseif (strtolower($domain) == 'internet2') { + $address = $groupName . '@lists.internet2.edu'; + } else { + $address = $groupName . '@lists.' . strtolower($domain) . '.org'; + } + $group['friendlyEmail'] = $address; + $arrayIndex += 1; + } + return $groups; } /** @@ -629,7 +699,7 @@ public function paginate($conditions) { * @return array Listing of Groups in WG format for display * */ - private function getFriendlyWorkingGroupName(array $groups) { + private function getFriendlyWorkingGroupName(array $groups, $method) { $arrayIndex = 0; @@ -642,8 +712,8 @@ private function getFriendlyWorkingGroupName(array $groups) { $stemSections = explode(':', $group['name']); //Get second to last stem section $sectionCount = count($stemSections) - 2; - if (in_array($stemSections[$sectionCount], $topLevelWG) === false){ - $topLevelWG[] = $stemSections[$sectionCount]; + if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { + $topLevelWG[] = $stemSections[$sectionCount]; } } } @@ -659,7 +729,7 @@ private function getFriendlyWorkingGroupName(array $groups) { //Get second to last stem section $sectionCount = count($stemSections) - 2; //If group not part of a top level WG, then do not show! - if (in_array($stemSections[$sectionCount], $topLevelWG) === false){ + if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { break; } $group['WGName'] = $stemSections[$sectionCount]; @@ -694,11 +764,13 @@ private function getFriendlyWorkingGroupName(array $groups) { } $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') { -// $workingGroups[] = $group; -// } - $workingGroups[] = $group; + if ($method == 'member') { + if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owners') { + $workingGroups[] = $group; + } + } else { + $workingGroups[] = $group; + } unset($groups[$arrayIndex]); } } @@ -736,27 +808,6 @@ private function getFriendlyWorkingGroupName(array $groups) { return $finalWorkingGroups; } - private function getFriendlyEmailName(array $groups) { - - foreach($groups as &$group) { - $appCount = 0; - $appName = ''; - $stems = explode(':', $group['name']); - $sectionCount = count($stems) - 2; - $groupName = $stems[$sectionCount]; - $domain = $stems[2]; - if (strtolower($domain) == 'incommon') { - $address = $groupName . '@lists.incommon.org'; - } elseif (strtolower($domain) == 'internet2') { - $address = $groupName . '@lists.internet2.edu'; - } else { - $address = $groupName . '@lists.' . strtolower($domain) . '.org'; - } - $group['friendlyEmail'] = $address; - } - return $groups; - } - /** * Verify that the AdHoc groups are only coming from stems listed in $stemsAdHocAllowed * From 4a3e1fca9eb3828c1edc9e87c43385c66b857511 Mon Sep 17 00:00:00 2001 From: axman Date: Fri, 1 Oct 2021 11:50:05 -0700 Subject: [PATCH 051/143] ICPCO-168 --- Lib/GrouperApiAccess.php | 76 ++++++++++++++++++++++++++++++---------- Model/GrouperGroup.php | 4 +-- 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index 091e994..00edecf 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -192,14 +192,27 @@ public function getOptionalGroups(array $queryData) { * */ public function getOwnedGroups(array $queryData) { - $queryData['groupType'] = 'Owner'; try { - $results = $this->useMembershipUrl($queryData); + $queryData['groupType'] = 'admin'; + $resultsAdmin = $this->useMembershipUrl($queryData); - if (isset($results['WsGetMembershipsResults']['wsGroups']) && $results['WsGetMembershipsResults']['wsGroups'] != NULL) { - return $results['WsGetMembershipsResults']['wsGroups']; + $queryData['groupType'] = 'update'; + $resultsUpdate = $this->useMembershipUrl($queryData); + + if (isset($resultsAdmin['WsGetMembershipsResults']['wsGroups']) && $resultsAdmin['WsGetMembershipsResults']['wsGroups'] != NULL) { + $admins = $resultsAdmin['WsGetMembershipsResults']['wsGroups']; + } else { + $admins = array(); } + + if (isset($resultsUpdate['WsGetMembershipsResults']['wsGroups']) && $resultsUpdate['WsGetMembershipsResults']['wsGroups'] != NULL) { + $updaters = $resultsUpdate['WsGetMembershipsResults']['wsGroups']; + } else { + $updaters = array(); + } + + return $this->removeDuplicates($admins, $updaters); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); throw $e; @@ -208,6 +221,40 @@ public function getOwnedGroups(array $queryData) { } + /** + * Currently not being used, but would be needed if Bill K does not want to show a group where + * the user is the admin and the updater. + * + * @param array $arrOne + * @param array $arrTwo + * @return array + */ + public function removeDuplicates(array $arrOne, array $arrTwo) { + + //Determine which array is bigger and use as base + $countOne = count($arrOne); + $countTwo = count($arrTwo); + if($countOne >= $countTwo) { + $arrL = $arrOne; + $arrS = $arrTwo; + } else { + $arrL = $arrTwo; + $arrS = $arrOne; + } + + foreach ($arrL as $large) { + foreach ($arrS as $key => $val) { + if ($large['uuid'] == $val['uuid']) { + unset($arrS[$key]); + } + } + } + + $results = array_merge_recursive($arrL, $arrS); + return $results; + } + + /** * Get members associated to a specific Grouper Group * @@ -255,7 +302,7 @@ public function getMembersInGroup(array $queryData) { * @throws GrouperLiteException */ public function getOwnedStems(array $queryData) { - $queryData['groupType'] = 'StemOwner'; + $queryData['groupType'] = 'stemAdmin'; try { $results = $this->useMembershipUrl($queryData); @@ -286,28 +333,20 @@ private function useMembershipUrl(array $queryData) { $groupType = $queryData['groupType']; $userId = $queryData['userId']; - if ($groupType == 'Optins') { - $fieldName = "optins"; + if ($groupType == 'optins' || $groupType == 'optouts') { $subjectId = "GrouperAll"; - } elseif ($groupType == 'Optouts') { - $fieldName = "optouts"; - $subjectId = "GrouperAll"; - } elseif ($groupType == 'Owner') { - $fieldName = "admin"; - $subjectId = $userId; - } elseif ($groupType == 'StemOwner') { - $fieldName = "stemAdmin"; + } elseif ($groupType == 'admin' || $groupType == 'update' || $groupType == 'stemAdmin') { $subjectId = $userId; } else { CakeLog::write('error', __METHOD__ . ": Option of $groupType is not supported"); throw new GrouperLiteException("Option of $groupType is not supported"); } - if ($groupType == 'Optins' || $groupType == 'Optouts') { + 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, + "fieldName" => $groupType, "wsSubjectLookups" => array( array("subjectId" => $subjectId), array("subjectId" => $userId) @@ -318,7 +357,7 @@ private function useMembershipUrl(array $queryData) { //Build request logic $groupsToShow = array( "WsRestGetMembershipsRequest" => array( - "fieldName" => $fieldName, + "fieldName" => $groupType, "wsSubjectLookups" => array( array("subjectId" => $subjectId) ) @@ -326,7 +365,6 @@ private function useMembershipUrl(array $queryData) { ); } - $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); $connectionUrl = "{$this->config['fullUrl']}/memberships"; diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 86f5e41..52bd180 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -163,7 +163,7 @@ public function filteredMemberOfGroups(array $conditions) { $this->initApi(); try { - $conditions['groupType'] = 'Optouts'; + $conditions['groupType'] = 'optouts'; $memberOfGroups = $this->memberOfGroups($conditions); // Determine which groups can be left by user, if want. @@ -383,7 +383,7 @@ public function optinGroups(array $conditions) { $this->initApi(); try { - $conditions['groupType'] = 'Optins'; + $conditions['groupType'] = 'optins'; $joinOrLeave = $this->grouperAPI->getOptionalGroups($conditions); $userGroups = $this->memberOfGroups($conditions); From d3fe3fb987b157bd95c16266dd9f6603b8bd522b Mon Sep 17 00:00:00 2001 From: axman Date: Fri, 8 Oct 2021 10:31:24 -0700 Subject: [PATCH 052/143] fixes for ICPCO-169,170 and 172 --- Controller/GrouperGroupsController.php | 78 +++++++------------------ Lib/GrouperApiAccess.php | 43 ++++++++++++++ Lib/GrouperHTTPWrapper.php | 3 +- Model/GrouperGroup.php | 9 ++- View/CoGrouperLites/display.ctp | 4 +- View/GrouperGroups/emaillistsmanage.ctp | 11 +--- View/GrouperGroups/emaillistsmember.ctp | 12 +--- View/GrouperGroups/emaillistsoptin.ctp | 11 +--- 8 files changed, 86 insertions(+), 85 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index c02afac..e9baa80 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -107,66 +107,32 @@ public function index() { ); } - /** - * Display of Grouper Group Information, such as Group Properties, Members and Attributes - * - */ - public function groupInfo() { - $name = urldecode($this->request->query['groupname']); - - $this->set('title', _txt('pl.grouperlite.title.groupinfo')); - - try { - $details = $this->GrouperGroup->groupDescriptions($name); - $this->set('groupergroupsdetail', $details[0]); - - } catch (Exception $e) { - CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); - - $this->set('groupergroupsdetail', array()); - $this->Flash->set(_txt('pl.grouperlite.message.flash.info-group-failed'), array('key' => 'error')); - } - - try { - $groupMembers = $this->membersInGroup(); - $this->set('groupergroupssubscribers', $groupMembers); - } catch (Exception $e) { - CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); - - $this->set('groupergroupssubscribers', array()); - $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); - } - - $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); - $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); - } - /** * Show all members of group in Grouper Group detail page * Called from method GroupInfo * */ - public function membersInGroup() { - $groupName = urldecode($this->request->query['groupname']); - - //Set initial - $scope = [ - 'groupName' => $groupName - ]; - - $details = []; - - try { - $details = $this->GrouperGroup->membersInGroup($scope); - - } catch (Exception $e) { - CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); - - $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); - } - - return $details; - } +// public function membersInGroup() { +// $groupName = urldecode($this->request->query['groupname']); +// +// //Set initial +// $scope = [ +// 'groupName' => $groupName +// ]; +// +// $details = []; +// +// try { +// $details = $this->GrouperGroup->membersInGroup($scope, $this->userId); +// +// } catch (Exception $e) { +// CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); +// +// $this->Flash->set(_txt('pl.grouperlite.message.flash.group-detail-members-failed'), array('key' => 'error')); +// } +// +// return $details; +// } /** * Show all members of group in Grouper Group detail page @@ -193,7 +159,7 @@ public function groupSubscribers() { ]; try { - $subscribers = $this->GrouperGroup->membersInGroup($scope); + $subscribers = $this->GrouperGroup->membersInGroup($scope, $this->userId); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index 00edecf..33466a6 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -264,6 +264,16 @@ public function removeDuplicates(array $arrOne, array $arrTwo) { */ public function getMembersInGroup(array $queryData) { + // First verify that user has read access to group + if ($this->verifyPrivileges($queryData, 'read') === false) { + return array( + array( + "sourceId" => "ldap", + "name" => "You do not have access to memberships" + ) + ); + } + //Build request logic $usersToShow = array( "WsRestGetMembersRequest" => array( @@ -294,6 +304,39 @@ public function getMembersInGroup(array $queryData) { return array(); } + public function verifyPrivileges(array $queryData, string $privilege) { + //Build request logic + $verifyPrivs = array( + "WsRestGetGrouperPrivilegesLiteRequest" => array( + "privilegeName" => $privilege, + "groupName" => $queryData['groupName'], + "subjectId" => $queryData['userId'] + ) + ); + + $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); + $connectionUrl = "{$this->config['fullUrl']}/grouperPrivileges"; + + try { + $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($verifyPrivs)); + + // Parse out relevant records to send front end + if (isset($results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode']) && $results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode'] != NULL) { + if ($results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode'] == 'SUCCESS_ALLOWED') { + return true; + } else { + return false; + } + } + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; + } + + return array(); + + } + /** * Gets all Stems/Folders where User is admin/owner * diff --git a/Lib/GrouperHTTPWrapper.php b/Lib/GrouperHTTPWrapper.php index 625d96c..3439d50 100644 --- a/Lib/GrouperHTTPWrapper.php +++ b/Lib/GrouperHTTPWrapper.php @@ -137,7 +137,8 @@ private function _verifyResults(HttpSocketResponse $apiResults): array { $mainKey = key($resBody); $apiSuccess = $resBody[$mainKey]['resultMetadata']['resultCode']; - if ($apiSuccess != 'SUCCESS') { + // Had to add SUCCESS_NOT_ALLOWED and SUCCESS_ALLOWED for checking privs on a group for a user + if ($apiSuccess != 'SUCCESS' && $apiSuccess != 'SUCCESS_NOT_ALLOWED' && $apiSuccess != 'SUCCESS_ALLOWED') { CakeLog::write('error', __METHOD__ . ': Result Code was ' . var_export($apiSuccess, true)); CakeLog::write('error', __METHOD__ . ': Error of ' . var_export($apiResults->body(), true)); throw new GrouperLiteException('Result from Grouper WS was' . var_export($apiSuccess, true)); diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 52bd180..f566cd7 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -315,16 +315,23 @@ public function ownerGroups(array $conditions) { * members * * @param array $conditions Listing of conditions for display of records + * @param string $userId Id of User * @return array Listing of members in requested Grouper Group * @throws GrouperLiteException Captured in Controller * */ - public function membersInGroup(array $conditions) { + public function membersInGroup(array $conditions, string $userId) { $this->initApi(); + $conditions['userId'] = $userId; + try { $groupMembers = $this->grouperAPI->getMembersInGroup($conditions); + if (count($groupMembers) < 1){ + return $groupMembers; + } + $finalMembers = array(); foreach ($groupMembers as $member) { if ($member['sourceId'] !== 'g:gsa') { diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index c79eb73..f112905 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -94,7 +94,7 @@ echo $this->element('GrouperLite.base-styles'); array( 'plugin' => "grouper_lite", 'controller' => 'grouper_groups', - 'action' => 'emaillistsMember', + 'action' => 'emaillistsmember', 'co' => $coid, 'glid' => $glid ) @@ -117,7 +117,7 @@ echo $this->element('GrouperLite.base-styles'); array( 'plugin' => "grouper_lite", 'controller' => 'grouper_groups', - 'action' => 'emaillistsManage', + 'action' => 'emaillistsmanage', 'co' => $coid, 'glid' => $glid ) diff --git a/View/GrouperGroups/emaillistsmanage.ctp b/View/GrouperGroups/emaillistsmanage.ctp index 09793f6..7657544 100644 --- a/View/GrouperGroups/emaillistsmanage.ctp +++ b/View/GrouperGroups/emaillistsmanage.ctp @@ -17,14 +17,9 @@ - Html->link( - isset($group['name']) ? $group['domain'] . ':' . $group['name'] : "--", - array( - 'controller' => 'grouper_groups', - 'action' => 'emaillistinfo', - '?' => array('groupname' => urlencode($group['name'])) - ) - ) ?> + + + (10) | diff --git a/View/GrouperGroups/emaillistsmember.ctp b/View/GrouperGroups/emaillistsmember.ctp index d6952ec..c26d517 100644 --- a/View/GrouperGroups/emaillistsmember.ctp +++ b/View/GrouperGroups/emaillistsmember.ctp @@ -16,15 +16,9 @@ $group) : ?> - Html->link( - - $group['friendlyEmail'] ?? "No Name", - array( - 'controller' => 'grouper_groups', - 'action' => 'emaillistinfo', - '?' => array('groupname' => urlencode($group['name'])) - ) - ) ?> + + + element('GrouperLite.Components/optAction', array( diff --git a/View/GrouperGroups/emaillistsoptin.ctp b/View/GrouperGroups/emaillistsoptin.ctp index bfb2399..391109c 100644 --- a/View/GrouperGroups/emaillistsoptin.ctp +++ b/View/GrouperGroups/emaillistsoptin.ctp @@ -15,14 +15,9 @@ - Html->link( - $group['friendlyEmail'] ?? "No Name", - array( - 'controller' => 'grouper_groups', - 'action' => 'emaillistinfo', - '?' => array('groupname' => urlencode($group['name'])) - ) - ) ?> + + + @@ -128,7 +128,7 @@ $numColumns = count($columns); $group) : ?> - + @@ -161,4 +161,5 @@ $numColumns = count($columns);

+ element('Components/subscriberList'); ?> \ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index abeced4..81a9584 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -179,4 +179,6 @@ $numColumns = count($columns);

+ + element('Components/subscriberList'); ?> \ No newline at end of file From f78807348ca09ce788fdcaff7699c08def04e80f Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 27 Oct 2021 14:40:35 -0700 Subject: [PATCH 056/143] Applied toggle fix to owner page --- View/GrouperGroups/groupowner.ctp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 81a9584..6484834 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -95,7 +95,7 @@ $numColumns = count($columns); - @@ -111,7 +111,7 @@ $numColumns = count($columns); $group) : ?> - + From ba3a92c19cdda67242df8640689183581c3d4f7f Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 27 Oct 2021 15:47:16 -0700 Subject: [PATCH 057/143] Fixed accessibility issues, fixed caret icon --- View/CoGrouperLites/display.ctp | 4 ++-- View/Elements/Components/subscriberList.ctp | 2 +- View/GrouperGroups/emaillistsmanage.ctp | 2 +- View/GrouperGroups/groupmember.ctp | 5 +++++ View/GrouperGroups/groupowner.ctp | 6 ++++++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index f112905..ed399f5 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -48,7 +48,7 @@ echo $this->element('GrouperLite.base-styles');
-
 
+

 

-
 
+

 

diff --git a/View/Elements/Components/navigation-groups.ctp b/View/Elements/Components/navigation-groups.ctp index 23a6d54..3c1f816 100644 --- a/View/Elements/Components/navigation-groups.ctp +++ b/View/Elements/Components/navigation-groups.ctp @@ -37,7 +37,7 @@ ?>
- + - +
Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => ' } else { btn.find('i').removeClass('fa-caret-down').addClass('fa-caret-right'); } - }) + }); $('.collapse-wg-working-group-parent').on('hide.bs.collapse', function(ev) { $(this).siblings('.collapse-wg-working-group').collapse('hide'); diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index f9e2029..1a98706 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -15,6 +15,8 @@ if ($isuserowner !== 'T') { } $numColumns = count($columns); + +$collapsed = true; ?> 0 || count($wgmemberships) > 0) : ?>
@@ -36,14 +38,14 @@ $numColumns = count($columns); - $group) : ?> - + @@ -54,14 +56,14 @@ $numColumns = count($columns); - + element('GrouperLite.Components/optAction', array( 'member' => $group['optOut'], 'action' => 'leavegroup', 'group' => $group['name'], 'idx' => $key )) : ''; ?> - + - - - No working groups. + + No working groups. - + - - + element('GrouperLite.Components/optAction', array( 'member' => $wggroup['optOut'], 'action' => 'leavegroup', 'group' => $wggroup['workingGroupId'], 'idx' => $key )) : ''; ?> - @@ -135,7 +137,7 @@ $numColumns = count($columns); $group) : ?> - + @@ -145,11 +147,8 @@ $numColumns = count($columns); - + - - - diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 99cb91f..217337f 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -15,6 +15,9 @@ if ($isuserowner !== 'T') { } $numColumns = count($columns); + +$collapsed = $config->defaultCollapse ?? false; + ?> 0 || count($wgoptins) > 0) : ?>
@@ -36,14 +39,14 @@ $numColumns = count($columns); - $group) : ?> - + @@ -64,14 +67,14 @@ $numColumns = count($columns); - $wgoptin) : ?> - + diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index b6dc894..3ea0426 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -16,6 +16,8 @@ if ($isuserowner !== 'T') { } $numColumns = count($columns); + +$collapsed = true; ?> 0 || count($wgowners) > 0) : ?>
@@ -37,9 +39,9 @@ $numColumns = count($columns); - @@ -51,7 +53,7 @@ $numColumns = count($columns); - + @@ -63,18 +65,14 @@ $numColumns = count($columns); - - + element('GrouperLite.Components/optAction', array( 'member' => $group['optOut'], 'action' => 'leavegroup', 'group' => $group['name'], 'idx' => $key )) : ''; ?> - @@ -99,46 +97,42 @@ $numColumns = count($columns); - - - No working groups. + + No working groups. - + - $group) : ?> - + - - + element('GrouperLite.Components/optAction', array( 'member' => $group['optOut'], 'action' => 'leavegroup', 'group' => $group['name'], 'idx' => $key )) : ''; ?> - + $group) : ?> - + @@ -166,7 +160,7 @@ $numColumns = count($columns); - + From 7eb5750971c85fa92ec16342ccb70d2b83db42c9 Mon Sep 17 00:00:00 2001 From: axel stohn Date: Sat, 25 Dec 2021 18:42:35 +0000 Subject: [PATCH 064/143] GrouperGroupsController.php edited online with Bitbucket --- Controller/GrouperGroupsController.php | 28 +++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 2d52501..9adf400 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -50,7 +50,6 @@ class GrouperGroupsController extends GrouperLiteAppController 'page' => 1 ); - /** * Overrides parent beforeFilter to verify that Session contains the correct API settings. * @@ -63,7 +62,7 @@ public function beforeFilter() { //Need to find which plugin instance choosing, if more than one from cm_co_grouper_lites // table being used in COmanage. $grouperConnData = $this->Session->read('Plugin.Grouper.Api'); - if ($this->Session->check('Plugin.Grouper.Api.id') && count($grouperConnData) == 6) { + if ($this->Session->check('Plugin.Grouper.Api.id') && count($grouperConnData) == 9) { if (isset($this->passedArgs['glid'])) { if ($this->Session->read('Plugin.Grouper.Api.id') !== $this->passedArgs['glid']) { $this->setConnection(); @@ -94,6 +93,10 @@ private function setConnection() { $this->Session->write('Plugin.Grouper.Api.user', $connectionInfo['CoGrouperLite']['connUser']); $this->Session->write('Plugin.Grouper.Api.pass', $connectionInfo['CoGrouperLite']['connPass']); $this->Session->write('Plugin.Grouper.Api.grouperUrl', $connectionInfo['CoGrouperLite']['grouperUrl']); + + $this->Session->write('Plugin.Grouper.Api.adHocHeading', $connectionInfo['CoGrouperLite']['adHocHeading']); + $this->Session->write('Plugin.Grouper.Api.wgHeading', $connectionInfo['CoGrouperLite']['wgHeading']); + $this->Session->write('Plugin.Grouper.Api.defaultCollapse', $connectionInfo['CoGrouperLite']['defaultCollapse']); } /** @@ -207,6 +210,12 @@ public function groupOwner() { $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $config = [ + "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), + "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), + "wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading') + ]; + $this->set('config', $config); } @@ -274,6 +283,12 @@ public function groupMember() { $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $config = [ + "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), + "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), + "wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading') + ]; + $this->set('config', $config); } /** @@ -282,6 +297,7 @@ public function groupMember() { public function groupOptin() { $this->set('title', _txt('pl.grouperlite.title.groupoptin')); + //Set initial settings for pagination $scope = [ 'userId' => $this->userId, @@ -338,6 +354,12 @@ public function groupOptin() { } $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $config = [ + "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), + "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), + "wgHeading" => CakeSession::read('Plugin.Grouper.Api.wgHeading') + ]; + $this->set('config', $config); } /** @@ -746,4 +768,4 @@ private function hackDescription($description) { $newString = substr($description, strpos($description, ".") + 1); return trim($newString); } -} +} \ No newline at end of file From 7542622b08b10e17213eaa03fad2ba3bee479bc5 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 3 Jan 2022 09:05:05 -0700 Subject: [PATCH 065/143] Implemented db config variables --- Model/CoGrouperLite.php | 3 ++- View/CoGrouperLites/fields.inc | 7 ++++--- View/GrouperGroups/groupmember.ctp | 7 ++++--- View/GrouperGroups/groupoptin.ctp | 6 +++--- View/GrouperGroups/groupowner.ctp | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Model/CoGrouperLite.php b/Model/CoGrouperLite.php index bc99cb2..de11090 100644 --- a/Model/CoGrouperLite.php +++ b/Model/CoGrouperLite.php @@ -90,7 +90,8 @@ class CoGrouperLite extends CoDashboardWidgetBackend { ), 'defaultCollapse' => array( 'rule' => array('minLength', 1), - 'required' => true + 'required' => false, + 'default' => 'collapsed' ), ); diff --git a/View/CoGrouperLites/fields.inc b/View/CoGrouperLites/fields.inc index d886a02..e68374f 100644 --- a/View/CoGrouperLites/fields.inc +++ b/View/CoGrouperLites/fields.inc @@ -270,6 +270,7 @@ print $this->Form->hidden('co_dashboard_widget_id', array('default' => $vv_dwid)
  • +
    Form->label('defaultCollapse', _txt('pl.grouperlite.config.default-collapse')) : _txt('pl.grouperlite.config.default-collapse')); ?> @@ -283,7 +284,7 @@ print $this->Form->hidden('co_dashboard_widget_id', array('default' => $vv_dwid) 'collapsed' => 'True', 'expanded' => 'False' ), array( - 'value' => $co_grouper_lites[0]['CoGrouperLite']['defaultCollapse'] === 'expanded', + 'value' => $co_grouper_lites[0]['CoGrouperLite']['defaultCollapse'], 'legend' => false, 'separator' => '  ' )); @@ -311,9 +312,9 @@ print $this->Form->hidden('co_dashboard_widget_id', array('default' => $vv_dwid)
  • - +

    -
    +
    \ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 1a98706..70c3d34 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -16,7 +16,8 @@ if ($isuserowner !== 'T') { $numColumns = count($columns); -$collapsed = true; +$collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; + ?> 0 || count($wgmemberships) > 0) : ?>
    @@ -39,7 +40,7 @@ $collapsed = true; @@ -87,7 +88,7 @@ $collapsed = true; diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 217337f..fb9f3bb 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -16,7 +16,7 @@ if ($isuserowner !== 'T') { $numColumns = count($columns); -$collapsed = $config->defaultCollapse ?? false; +$collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> 0 || count($wgoptins) > 0) : ?> @@ -40,7 +40,7 @@ $collapsed = $config->defaultCollapse ?? false; @@ -68,7 +68,7 @@ $collapsed = $config->defaultCollapse ?? false; diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 3ea0426..3ba78bb 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -17,7 +17,7 @@ if ($isuserowner !== 'T') { $numColumns = count($columns); -$collapsed = true; +$collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> 0 || count($wgowners) > 0) : ?>
    @@ -40,7 +40,7 @@ $collapsed = true; @@ -98,7 +98,7 @@ $collapsed = true; From 01c22cff09ab8a2b243f855a254be530e7d88e6d Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 3 Jan 2022 14:49:56 -0700 Subject: [PATCH 066/143] Added cache meta tags --- View/GrouperGroups/base.ctp | 17 +++++++++++++++++ View/GrouperGroups/groupinfo.ctp | 4 +++- View/GrouperGroups/groupmember.ctp | 4 +++- View/GrouperGroups/groupoptin.ctp | 4 +++- View/GrouperGroups/groupowner.ctp | 6 +++--- 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/View/GrouperGroups/base.ctp b/View/GrouperGroups/base.ctp index b908373..c470d70 100644 --- a/View/GrouperGroups/base.ctp +++ b/View/GrouperGroups/base.ctp @@ -1,4 +1,21 @@ Html->meta( + array('http-equiv' => 'Cache-Control', 'content' => 'no-cache, no-store, must-revalidate'), + null, + array('inline' => false) +); +echo $this->Html->meta( + array('http-equiv' => 'Pragma', 'content' => 'no-cache'), + null, + array('inline' => false) +); +echo $this->Html->meta( + array('http-equiv' => 'Expires', 'content' => '0'), + null, + array('inline' => false) +); +?> +element('GrouperLite.base-styles'); print $this->Html->css('GrouperLite.co-grouper-plugin') . "\n "; ?> diff --git a/View/GrouperGroups/groupinfo.ctp b/View/GrouperGroups/groupinfo.ctp index 1fd387b..07907f5 100644 --- a/View/GrouperGroups/groupinfo.ctp +++ b/View/GrouperGroups/groupinfo.ctp @@ -1,3 +1,4 @@ + extend('/GrouperGroups/base'); ?> Html->addCrumb(_txt('pl.grouperlite.title.groupinfo')); ?>

    - +
    @@ -42,3 +43,4 @@ $attrUrlBase = $baseUrl . $path . $attrOperation;
    + \ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 70c3d34..d06614f 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -1,3 +1,4 @@ + extend('/GrouperGroups/base'); ?> Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> @@ -175,4 +176,5 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;
    -element('Components/subscriberList'); ?> \ No newline at end of file +element('Components/subscriberList'); ?> + \ No newline at end of file diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index fb9f3bb..ce1c7ef 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -1,3 +1,4 @@ + extend('/GrouperGroups/base'); ?> Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?> @@ -111,4 +112,5 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;

    - \ No newline at end of file + + \ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 3ba78bb..a240d3b 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -1,3 +1,4 @@ + extend('/GrouperGroups/base'); ?> Html->addCrumb(_txt('pl.grouperlite.nav.groups-presided')); ?> element('Components/navigation-groups', array('active' => 'groupowner')); ?> @@ -189,6 +190,5 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false;

    - - -element('Components/subscriberList'); ?> \ No newline at end of file +element('Components/subscriberList'); ?> + \ No newline at end of file From 8f25eded5729fd52ae3ff1fe3ed6fa6b7bdbc332 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Sun, 9 Jan 2022 09:30:57 -0700 Subject: [PATCH 067/143] fix member list access and no show main WG for admin --- Controller/GrouperGroupsController.php | 6 +--- Lib/GrouperApiAccess.php | 50 ++------------------------ 2 files changed, 4 insertions(+), 52 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 9adf400..4f353d2 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -726,11 +726,7 @@ private function breakoutGroups(array $recordSet, $type = 'basic') { $wgRec['workingDesc'] = $this->hackDescription($rec['description']); //Capturing record for incommon-collab since deleting a few lines below. if ($rec['WGApp'] == 'incommon-collab') { - if ($type == 'basic') { - //Removing record with stem of 'incommon-collab' since displaying on groups Member page, - // will show on Admin page - unset($wgRec['Groups'][$subCount]); - } + unset($wgRec['Groups'][$subCount]); } $subCount += 1; } diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index fefbac4..f336b95 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -264,20 +264,12 @@ public function removeDuplicates(array $arrOne, array $arrTwo) { public function getMembersInGroup(array $queryData) { try { - // First verify that user has read access to group - $privs = array('read', 'admin', 'update'); - if ($this->verifyPrivileges($queryData, $privs) === false) { - return array( - array( - "sourceId" => "ldap", - "name" => "You do not have access to memberships" - ) - ); - } - //Build request logic $usersToShow = array( "WsRestGetMembersRequest" => array( + "actAsSubjectLookup" => array( + "subjectId" => $queryData['userId'] + ), "wsGroupLookups" => array( array("groupName" => $queryData['groupName']) ), @@ -304,42 +296,6 @@ public function getMembersInGroup(array $queryData) { return array(); } - /** - * @param array $queryData Array of conditions for querying - * @param array $privilege attributes that need verifying for a user - * @return bool If user has said attribute correctly set - * @throws GrouperLiteException - */ - public function verifyPrivileges(array $queryData, array $privileges) { - //Build request logic - $verifyPrivs = array( - "WsRestGetGrouperPrivilegesLiteRequest" => array( - "privilegeName" => $privilege, - "groupName" => $queryData['groupName'], - "subjectId" => $queryData['userId'] - ) - ); - - $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); - $connectionUrl = "{$this->config['fullUrl']}/grouperPrivileges"; - - try { - $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($verifyPrivs)); - - // Parse out relevant records to send front end - if (isset($results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode']) && $results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode'] != NULL) { - if ($results['WsGetGrouperPrivilegesLiteResult']['resultMetadata']['resultCode'] == 'SUCCESS_ALLOWED') { - return true; - } - } - } catch (Exception $e) { - CakeLog::write('error', __METHOD__ . ': An error occurred'); - throw $e; - } - - return false; - } - /** * Gets all Stems/Folders where User is admin/owner * From 7ae003d1a9b7d7ac76c4be26f34db6f1de552b9e Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 8 Mar 2022 10:04:58 -0700 Subject: [PATCH 068/143] Removed email list navigation --- View/CoGrouperLites/display.ctp | 9 +++++---- View/Elements/Components/navigation-groups.ctp | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index ed399f5..052c999 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -39,15 +39,15 @@ echo $this->element('GrouperLite.base-styles');
    -
    +
    -
    +
    Html->image('GrouperLite.grouper-logo.png', array('class' => 'logo-fluid')); ?>
    -
    diff --git a/View/Elements/Components/navigation-groups.ctp b/View/Elements/Components/navigation-groups.ctp index 3c1f816..cd04cf8 100644 --- a/View/Elements/Components/navigation-groups.ctp +++ b/View/Elements/Components/navigation-groups.ctp @@ -68,6 +68,7 @@
    + Html->url( @@ -81,4 +82,5 @@  
    + */ ?> \ No newline at end of file From 49096bfca9ad9c1d19745fb87a3baee927801efc Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 9 Mar 2022 14:21:05 -0700 Subject: [PATCH 069/143] Added buttons for adding/removing users --- Lib/GrouperApiAccess.php | 5 +- Lib/lang.php | 5 + View/Elements/Components/subscriberList.ctp | 195 ++++++++++++++++---- 3 files changed, 162 insertions(+), 43 deletions(-) diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index f336b95..598d3f8 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -84,8 +84,9 @@ public function getGrouperMemberOfGroups(array $queryData) { //Build request logic $userId = $queryData['userId']; - $connectionUrl = "{$this->config['fullUrl']}/subjects/$userId/groups?"; - $connectionUrl .= "wsLiteObjectType=WsRestGetGroupsLiteRequest&actAsSubjectSourceId=ldap&actAsSubjectId=$userId"; + $connectionUrl = "{$this->config['fullUrl']}/subjects/$userId/groups"; + // $connectionUrl = "{$this->config['fullUrl']}/subjects/$userId/groups?"; + // $connectionUrl .= "wsLiteObjectType=WsRestGetGroupsLiteRequest&actAsSubjectSourceId=ldap&actAsSubjectId=$userId"; try { $results = $this->http->sendRequest('GET', $connectionUrl); diff --git a/Lib/lang.php b/Lib/lang.php index 566d182..e338d76 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -113,6 +113,11 @@ 'pl.grouperlite.action.members' => 'Members', 'pl.grouperlite.action.close' => 'Close', 'pl.grouperlite.action.clear' => 'Clear', + 'pl.grouperlite.action.add-user' => 'Add', + 'pl.grouperlite.action.remove-user' => 'Remove', + 'pl.grouperlite.message.user-not-found-error' => 'Error: User not found.', + 'pl.grouperlite.message.user-not-added-error' => 'Error: Unable to add user.', + 'pl.grouperlite.message.user-not-removed-error' => 'Error: Unable to remove user.', 'pl.grouperlite.form.group.template.label' => 'Select a template', 'pl.grouperlite.form.group.template.empty' => '(choose one)', diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index d2ed38f..d15b0f0 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -1,5 +1,5 @@
    diff --git a/View/GrouperGroups/groupfields.inc b/View/GrouperGroups/groupfields.inc index a130056..c3b3066 100644 --- a/View/GrouperGroups/groupfields.inc +++ b/View/GrouperGroups/groupfields.inc @@ -75,7 +75,7 @@ $PRIVILEGES = array('READ', 'VIEW', 'OPTIN', 'OPTOUT', 'ATTRIBUTE_READ'); '', '', '', - '', + '', '' ].join(''); diff --git a/View/GrouperGroups/groupinfo.ctp b/View/GrouperGroups/groupinfo.ctp index 07907f5..9e74792 100644 --- a/View/GrouperGroups/groupinfo.ctp +++ b/View/GrouperGroups/groupinfo.ctp @@ -24,7 +24,7 @@ $attrUrlBase = $baseUrl . $path . $attrOperation;
    diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index d06614f..f2db5b8 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -42,7 +42,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; @@ -65,21 +65,21 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; 'group' => $group['name'], 'idx' => $key )) : ''; ?> - - - - -   - - - + - No working groups. + None @@ -104,7 +104,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; @@ -119,7 +119,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; 'idx' => $key )) : ''; ?> - -   - - diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index ce1c7ef..00be779 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -42,7 +42,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; @@ -70,7 +70,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index fbea2ee..3eeb0ea 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -42,7 +42,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; @@ -74,7 +74,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; 'idx' => $key )) : ''; ?>   - + @@ -100,53 +100,53 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - No working groups. + None - - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $wggroup['optOut'], - 'action' => 'leavegroup', - 'group' => $wggroup['workingGroupId'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - - + + + + + + + + + element('GrouperLite.Components/optAction', array( + 'member' => $wggroup['optOut'], + 'action' => 'leavegroup', + 'group' => $wggroup['workingGroupId'], + 'idx' => $key + )) : ''; ?> + + + + +   + + + + + $group) : ?> From 34ec6232cfa936caeb189cb037c19dc332a80a12 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 20 Sep 2022 14:47:29 -0700 Subject: [PATCH 091/143] Fixed missing closing tag --- View/GrouperGroups/groupmember.ctp | 1 + 1 file changed, 1 insertion(+) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index f2db5b8..d180ebc 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -66,6 +66,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; 'idx' => $key )) : ''; ?> Date: Tue, 20 Sep 2022 15:17:25 -0700 Subject: [PATCH 092/143] Change stem to folder name in ui --- Model/GrouperGroup.php | 26 ++++++++++++++++++-------- View/GrouperGroups/groupmember.ctp | 2 +- View/GrouperGroups/groupoptin.ctp | 2 +- View/GrouperGroups/groupowner.ctp | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 7558152..d286cf3 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -59,7 +59,7 @@ class GrouperGroup extends GrouperLiteAppModel 'app:sympa:internet2', 'app:sympa:incommon', 'ref:incommon-collab', - 'ref:Internet2-collab' + 'ref:internet2-collab' ); //Stem for email groups, only email groups using this stem are viewable @@ -622,10 +622,9 @@ private function getFriendlyWorkingGroupName(array $groups, $method) $len = strlen($stem); if (substr(strtolower($group['name']), 0, $len) === $stem) { $stemSections = explode(':', $group['name']); - //Get second to last stem section - $sectionCount = count($stemSections) - 2; - if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { - $topLevelWG[] = $stemSections[$sectionCount]; + //Get third section, since will always by after ref:something:here + if (in_array($stemSections[2], $topLevelWG) === false) { + $topLevelWG[] = $stemSections[2]; } } } @@ -638,13 +637,15 @@ private function getFriendlyWorkingGroupName(array $groups, $method) // if match to name of group within WG mapping then start making a WG group array if (substr(strtolower($group['name']), 0, $len) === $stem) { $stemSections = explode(':', $group['name']); + $displaySections = explode(':', $group['displayName']); //Get second to last stem section - $sectionCount = count($stemSections) - 2; + $sectionCount = 2; //If group not part of a top level WG, then do not show! if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { break; } $group['WGName'] = $stemSections[$sectionCount]; + $group['WGShowName'] = $displaySections[$sectionCount]; //Get user type, which is after the WG name if (isset($stemSections[$sectionCount + 1])) { $group['WGRole'] = $stemSections[$sectionCount + 1]; @@ -693,17 +694,26 @@ private function getFriendlyWorkingGroupName(array $groups, $method) foreach ($workingGroups as $workingGroup) { //Need to set first group in final Working Group array if (count($finalWorkingGroups) == 0) { - $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + $finalWorkingGroups[] = array( + 'WGName' => $workingGroup['WGName'], + 'WGShowName' => $workingGroup['WGShowName'], + 'Groups' => array($workingGroup) + ); } else { $foundMatch = false; foreach ($finalWorkingGroups as &$finalWorkingGroup) { if ($finalWorkingGroup['WGName'] == $workingGroup['WGName']) { + $finalWorkingGroup['WGShowName'] = $workingGroup['WGShowName']; $finalWorkingGroup['Groups'][] = $workingGroup; $foundMatch = true; } } if (!$foundMatch) { - $finalWorkingGroups[] = array('WGName' => $workingGroup['WGName'], 'Groups' => array($workingGroup)); + $finalWorkingGroups[] = array( + 'WGName' => $workingGroup['WGName'], + 'WGShowName' => $workingGroup['WGShowName'], + 'Groups' => array($workingGroup) + ); } } } diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index d180ebc..da4477d 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -104,7 +104,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 00be779..9560043 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -77,7 +77,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; $wgoptin) : ?> - + diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 3eeb0ea..28c843b 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -113,7 +113,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; From 8b9539c42fd2e9ef367baf0d1a7967626386f378 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 22 Sep 2022 10:43:00 -0700 Subject: [PATCH 093/143] Removed grouper button from ad-hoc groups --- View/GrouperGroups/groupmember.ctp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index da4477d..c6afcbd 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -67,20 +67,6 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; )) : ''; ?> - - - -   - - - From f9cb1edcf70bae9070d13112a52ab746568c5b92 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Fri, 23 Sep 2022 07:40:42 -0700 Subject: [PATCH 094/143] Added popover for working group names --- View/Elements/base-styles.ctp | 4 ++++ View/GrouperGroups/groupmember.ctp | 21 ++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/View/Elements/base-styles.ctp b/View/Elements/base-styles.ctp index 86e29bb..9b5895d 100644 --- a/View/Elements/base-styles.ctp +++ b/View/Elements/base-styles.ctp @@ -120,6 +120,10 @@ animation: fadeInHalf 0.9s -0.3s infinite reverse; } + .popover { + max-width: 400px; + } + @keyframes fadeInHalf { from { opacity: 0.5; diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index c6afcbd..f90ce55 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -90,8 +90,11 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; @@ -108,23 +111,15 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - - - $group) : ?> - + + + From 4875d33480d4c2281dfabd0890e17ea3d164decf Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Sat, 24 Sep 2022 16:21:24 -0700 Subject: [PATCH 095/143] fix list members for incommon-internet2 groups --- View/GrouperGroups/groupmember.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index f90ce55..d85b8d6 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -108,7 +108,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; 'group' => $wggroup['workingGroupId'], 'idx' => $key )) : ''; ?> - From cdc28ea097190e46a068494e9a31aa1c0ebc33f6 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Thu, 29 Sep 2022 13:59:43 -0700 Subject: [PATCH 096/143] Grouper button visibility code --- Controller/GrouperGroupsController.php | 7 ++++ Model/GrouperGroup.php | 52 +++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 4900424..9ca510f 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -443,9 +443,11 @@ public function groupOwner() } } + $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); $config = [ "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), @@ -521,6 +523,7 @@ public function groupMember() $this->set('grouperbaseurl', $this->Session->read('Plugin.Grouper.Api.grouperUrl')); $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); $config = [ "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), @@ -594,6 +597,7 @@ public function groupOptin() } $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); $config = [ "defaultCollapse" => CakeSession::read('Plugin.Grouper.Api.defaultCollapse'), "adHocHeading" => CakeSession::read('Plugin.Grouper.Api.adHocHeading'), @@ -893,6 +897,7 @@ public function emaillistsOptin() $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); } public function emaillistsMember() @@ -949,6 +954,7 @@ public function emaillistsMember() $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); } public function emaillistsManage() @@ -965,6 +971,7 @@ public function emaillistsManage() $this->set('isuserowner', $this->GrouperGroup->isUserOwner($this->userId)); $this->set('isTemplateUser', $this->GrouperGroup->isTemplateUser($this->userId)); + $this->set('isGrouperVisible', $this->GrouperGroup->isGrouperVisible($this->userId)); } diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index d286cf3..86381ab 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -47,6 +47,9 @@ class GrouperGroup extends GrouperLiteAppModel /** @var string Group whose members can create Groups via Template process */ private $templateCreationGroup = 'ref:workinggroupadmins'; + /** @var string Group whose members cannot see Grouper button, even if admin */ + private $grouperVisibleGroup = 'app:comanage:LiteUI:grouperNotVisible'; + private $wgStemsTopLevel = array( 'ref:incommon-collab', 'ref:internet2-collab' @@ -104,6 +107,53 @@ public function isUserOwner(string $userId) } } + /** + * Verifies if user can see the Grouper link button. Even if owner, may be not allowed to see it. + * + * @param string $userId Id of User + * @return String T or F + * @throws GrouperLiteException + * + */ + public function isGrouperVisible(string $userId) + { + if (CakeSession::check('Plugin.Grouper.isGrouperVisible')) { + return CakeSession::read('Plugin.Grouper.isGrouperVisible'); + } + + $this->initApi(); + + try { + $args = array(); + $args['userId'] = $userId; + + $memberOfGroups = $this->grouperAPI->getGrouperMemberOfGroups($args); + + $memberOfGroups = $this->grouperAPI->getGrouperMemberOfGroups($args); + + //now cycle through and see if part of correct group to be able to use template + $member = 'T'; + foreach ($memberOfGroups as $memberOfGroup) { + if ($memberOfGroup['name'] == $this->grouperVisibleGroup) { + $member = 'F'; + break; + } + } + + if ($member == 'T') { + CakeSession::write('Plugin.Grouper.isGrouperVisible', 'T'); + return 'T'; + } + CakeSession::write('Plugin.Grouper.isGrouperVisible', 'F'); + return 'F'; + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; + } + } + + /** * Used to instantiate API class * @@ -678,7 +728,7 @@ private function getFriendlyWorkingGroupName(array $groups, $method) } $group['WGApp'] = $appName; if ($method == 'member') { - if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owners') { + if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owner') { $workingGroups[] = $group; } } else { From 0e0c76e6ca4a005919381e7e5651cdcda304bbc8 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 3 Oct 2022 13:12:00 -0700 Subject: [PATCH 097/143] removed buttons from work groups --- View/GrouperGroups/groupmember.ctp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index d85b8d6..2e831f9 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -97,22 +97,9 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - + - - - element('GrouperLite.Components/optAction', array( - 'member' => $wggroup['optOut'], - 'action' => 'leavegroup', - 'group' => $wggroup['workingGroupId'], - 'idx' => $key - )) : ''; ?> - - - $group) : ?> From 01e470520684ca19b13fbdec6afed9f41f8552a8 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Mon, 3 Oct 2022 14:20:23 -0700 Subject: [PATCH 098/143] Fixed isGrouperVisible --- View/GrouperGroups/groupowner.ctp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 28c843b..29d9e81 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -76,7 +76,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - + "> - + $group) : ?> - + From 859c4af09561aad4f4d093925b50af67b39a89b4 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Wed, 5 Oct 2022 10:52:35 -0700 Subject: [PATCH 099/143] ICPCO-225 --- Controller/GrouperGroupsController.php | 52 ++---------- Model/GrouperGroup.php | 42 ++++++---- View/GrouperGroups/groupoptin.ctp | 33 +------- View/GrouperGroups/groupowner.ctp | 108 +------------------------ 4 files changed, 37 insertions(+), 198 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 9ca510f..a30fac3 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -410,10 +410,7 @@ public function groupOwner() $data = $this->Paginator->paginate('GrouperGroup', $scope); - $finalData = $this->breakoutGroups($data, 'admin'); - - $this->set('groupsowners', $finalData['adHocGroups']); - $this->set('wgowners', $finalData['workingGroups']); + $this->set('groupsowners', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ' Search: ' . var_export($e->getMessage(), true)); @@ -428,10 +425,7 @@ public function groupOwner() $data = $this->Paginator->paginate('GrouperGroup', $scope); - $finalData = $this->breakoutGroups($data, 'admin'); - - $this->set('groupsowners', $finalData['adHocGroups']); - $this->set('wgowners', $finalData['workingGroups']); + $this->set('groupsowners', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -483,6 +477,7 @@ public function groupMember() $scope['method'] = 'getSearchedGroups'; $scope['searchcriteria'] = $searchCriteria; $scope['searchpage'] = 'filteredMemberOfGroups'; + $scope['ContainsWG'] = true; $data = $this->Paginator->paginate('GrouperGroup', $scope); @@ -559,12 +554,8 @@ public function groupOptin() $scope['searchpage'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - //$this->set('groupoptin', $data); - - $finalData = $this->breakoutGroups($data, 'optin'); - $this->set('groupoptins', $finalData['adHocGroups']); - $this->set('wgoptins', $finalData['workingGroups']); + $this->set('groupoptins', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . 'Search: ' . var_export($e->getMessage(), true)); @@ -580,12 +571,8 @@ public function groupOptin() $scope['method'] = 'optinGroups'; $data = $this->Paginator->paginate('GrouperGroup', $scope); - //$this->set('groupoptin', $data); - $finalData = $this->breakoutGroups($data, 'optin'); - - $this->set('groupoptins', $finalData['adHocGroups']); - $this->set('wgoptins', $finalData['workingGroups']); + $this->set('groupoptins', $data); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': ' . var_export($e->getMessage(), true)); @@ -1011,35 +998,6 @@ private function breakoutGroups(array $recordSet, $type = 'basic') } } - if ($type == 'basic' || $type == 'admin') { - //Need to surface Optout flag to top level of a Working Group - foreach ($wgData as &$wgRec) { - $subCount = 0; - foreach ($wgRec['Groups'] as $rec) { - if (isset($rec['optOut'])) { - $wgRec['optOut'] = true; - } - $wgRec['workingGroupId'] = $rec['name']; - $wgRec['workingGroupUUID'] = $rec['uuid']; - $wgRec['workingDesc'] = $this->hackDescription($rec['description']); - //Capturing record for incommon-collab since deleting a few lines below. - if ($rec['WGApp'] == 'incommon-collab') { - unset($wgRec['Groups'][$subCount]); - } - $subCount += 1; - } - - } - } elseif ($type == 'optin') { - //Working Groups that will show up on the Optin Page - foreach ($wgData as &$wgRec) { - $wgRec['workingGroupId'] = $wgRec['Groups'][0]['name']; - $wgRec['workingGroupUUID'] = $wgRec['Groups'][0]['uuid']; - $wgRec['workingDesc'] = $this->hackDescription($wgRec['Groups'][0]['description']); - unset($wgRec['Groups']); - } - } - return array( 'adHocGroups' => $notWGData, 'workingGroups' => $wgData diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index 86381ab..69e3a7c 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -632,10 +632,12 @@ public function paginate($conditions) } } else { - if ($method == 'getSearchedGroups' || $method == 'filteredMemberOfGroups') { + if (isset($conditions['ContainsWG']) && $method == 'getSearchedGroups') { + $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, 'member'); + } elseif ($method == 'filteredMemberOfGroups') { $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, 'member'); } else { - $friendlyResults = $this->getFriendlyWorkingGroupName($resultSet, ''); + $friendlyResults = $this->getFriendlyName(array_values($resultSet)); } } @@ -661,7 +663,6 @@ public function paginate($conditions) */ private function getFriendlyWorkingGroupName(array $groups, $method) { - $arrayIndex = 0; $workingGroups = array(); @@ -686,6 +687,12 @@ private function getFriendlyWorkingGroupName(array $groups, $method) $len = strlen($stem); // if match to name of group within WG mapping then start making a WG group array if (substr(strtolower($group['name']), 0, $len) === $stem) { + $tempGroup = $group; + if ($stem == 'ref:incommon-collab' || $stem == 'ref:internet2-collab') { + $mainGroup = true; + } else { + $mainGroup = false; + } $stemSections = explode(':', $group['name']); $displaySections = explode(':', $group['displayName']); //Get second to last stem section @@ -694,13 +701,13 @@ private function getFriendlyWorkingGroupName(array $groups, $method) if (in_array($stemSections[$sectionCount], $topLevelWG) === false) { break; } - $group['WGName'] = $stemSections[$sectionCount]; - $group['WGShowName'] = $displaySections[$sectionCount]; - //Get user type, which is after the WG name + $tempGroup['WGName'] = $stemSections[$sectionCount]; + $tempGroup['WGShowName'] = $displaySections[$sectionCount]; + // Get user type, which is after the WG name if (isset($stemSections[$sectionCount + 1])) { - $group['WGRole'] = $stemSections[$sectionCount + 1]; + $tempGroup['WGRole'] = $stemSections[$sectionCount + 1]; } else { - $group['WGRole'] = ''; + $tempGroup['WGRole'] = ''; } $appCount = 0; $appName = ''; @@ -720,21 +727,26 @@ private function getFriendlyWorkingGroupName(array $groups, $method) //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'; + $appName = $tempGroup['WGName'] . '@lists.' . 'internet2.edu'; } else { - $appName = $group['WGName'] . '@lists.' . 'incommon.org'; + $appName = $tempGroup['WGName'] . '@lists.' . 'incommon.org'; } } - $group['WGApp'] = $appName; + $tempGroup['WGApp'] = $appName; if ($method == 'member') { - if ($group['WGRole'] !== 'admins' && $group['WGRole'] !== 'owner') { - $workingGroups[] = $group; + // Screening out groups owned since this page show memberships not ownership! +// if ($tempGroup['WGRole'] !== 'admin' && $tempGroup['WGRole'] !== 'owner' && !$mainGroup ) { +// $workingGroups[] = $tempGroup; +// } + if(!$mainGroup) { + $workingGroups[] = $tempGroup; + unset($groups[$arrayIndex]); } } else { - $workingGroups[] = $group; + $workingGroups[] = $tempGroup; + unset($groups[$arrayIndex]); } - unset($groups[$arrayIndex]); } } $arrayIndex += 1; diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 9560043..de618d2 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -20,7 +20,7 @@ $numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> - 0 || count($wgoptins) > 0) : ?> + 0) : ?>
    element("pagination", array( 'goto' => false, @@ -65,34 +65,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - - - - - - - $wgoptin) : ?> - - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => false, - 'action' => 'joingroup', - 'group' => $wgoptin['workingGroupId'], - 'idx' => $key - )); ?> - - - - + element("pagination", array( 'goto' => false, @@ -108,7 +81,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; }); - +

    diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 29d9e81..590987c 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -20,7 +20,7 @@ $numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; ?> - 0 || count($wgowners) > 0) : ?> + 0) : ?>
    element("pagination", array( 'goto' => false, @@ -95,110 +95,6 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - - - - - - - - - None - - - - - - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $wggroup['optOut'], - 'action' => 'leavegroup', - 'group' => $wggroup['workingGroupId'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - - - - - $group) : ?> - - - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - - - - - $group) : ?> - - - - - - - - - - - - - - - - element("pagination", array( 'goto' => false, @@ -214,7 +110,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; }); - +

    From ded3c96e284a79093c1580739a110579c7bfa730 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Wed, 5 Oct 2022 10:54:21 -0700 Subject: [PATCH 100/143] Changes for I2 enviro --- Controller/GrouperGroupsController.php | 84 +++++++++++++------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index a30fac3..4e122ce 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -751,54 +751,54 @@ function isAuthorized() //TODO - This is needed for my dev enviro since I do not log in via I2 IdP // BEGIN =============================================== - if ($this->Session->check('Auth.User.username')) { - $this->userId = $this->Session->read('Auth.User.username'); - } +// if ($this->Session->check('Auth.User.username')) { +// $this->userId = $this->Session->read('Auth.User.username'); +// } // END =============================================== //TODO - Need to make the following code configurable in getting the user ID. In this case the code is // specific to the needs of I2. // BEGIN =============================================== -// $uid=$this->Session->read('Auth.User.co_person_id'); -// $username=$this->Session->read('Auth.User.username'); -// error_log("HUBING ================ " . $username); -// -// switch ($username) { -// case "chubing@internet2.edu": -// error_log("username is " . $username); -// $uid=32; -// break; -// case "pcaskey@internet2.edu": -// error_log("username is " . $username); -// $uid=28; -// break; -// case "ij@internet2.edu": -// error_log("username is " . $username); -// $uid=6842; -// break; -// case "aaschenbrener@internet2.edu": -// error_log("username is " . $username); -// $uid=13643; -// // 12430 in dev -// break; -// case "sho@internet2.edu": -// error_log("username is " . $username); -// $uid=6103; -// break; -// case "wkaufman@internet2.edu": -// error_log("username is " . $username); -// $uid=6830; -// break; -// } -// error_log("UID IS ================ " . $uid); -// -// if ($this->Session->check('Plugin.Grouper.UserId')) { -// $this->userId = $this->Session->read('Plugin.Grouper.UserId'); -// } else { -// $this->userId = $this->getUserId($uid); -// $this->Session->write('Plugin.Grouper.UserId', $this->userId); -// } + $uid=$this->Session->read('Auth.User.co_person_id'); + $username=$this->Session->read('Auth.User.username'); + error_log("HUBING ================ " . $username); + + switch ($username) { + case "chubing@internet2.edu": + error_log("username is " . $username); + $uid=32; + break; + case "pcaskey@internet2.edu": + error_log("username is " . $username); + $uid=28; + break; + case "ij@internet2.edu": + error_log("username is " . $username); + $uid=6842; + break; + case "aaschenbrener@internet2.edu": + error_log("username is " . $username); + $uid=13643; + // 12430 in dev + break; + case "sho@internet2.edu": + error_log("username is " . $username); + $uid=6103; + break; + case "wkaufman@internet2.edu": + error_log("username is " . $username); + $uid=6830; + break; + } + error_log("UID IS ================ " . $uid); + + if ($this->Session->check('Plugin.Grouper.UserId')) { + $this->userId = $this->Session->read('Plugin.Grouper.UserId'); + } else { + $this->userId = $this->getUserId($uid); + $this->Session->write('Plugin.Grouper.UserId', $this->userId); + } // END =============================================== // Determine what operations this user can perform From 246c6d4c7daec9f6d2435b1b622d3f1f73d12dce Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Thu, 6 Oct 2022 15:04:24 -0700 Subject: [PATCH 101/143] show group description not canned wording --- View/GrouperGroups/groupmember.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index 2e831f9..15ec3ac 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -114,7 +114,7 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - + From da1d7fd0654d894ba605803456847f7814d761e6 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Thu, 13 Oct 2022 08:58:45 -0700 Subject: [PATCH 102/143] Added title to subscriber list --- View/Elements/Components/subscriberList.ctp | 11 ++++++++--- View/GrouperGroups/groupmember.ctp | 4 +++- View/GrouperGroups/groupowner.ctp | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index c2803e1..6158726 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -2,7 +2,10 @@ */ ?> -
    -
    - Form->button(_txt('pl.grouperlite.form.group.action.save'), array( - 'type' => 'submit', - 'class' => 'btn btn-grouper btn-primary btn-lg btn-raised' - )); ?> -
    -
    - \ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index a2c40a2..ce7f61e 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -4,140 +4,112 @@ element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> 'pl.grouperlite.table.name', - 'role' => 'pl.grouperlite.table.role', - 'description' => 'pl.grouperlite.table.description', - 'action' => 'pl.grouperlite.table.action' -]; - -if ($isuserowner !== 'T') { - array_splice($columns, 1, 1); -} - -$numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; +$collapsed = false; + ?> - 0 || count($wgmemberships) > 0) : ?> -
    - element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - $label) : ?> - - - - - - - - - $group) : ?> - - - - - - - - - - - - - - - - - - - - - - - - - $group) : ?> - - - - - - - - - - - - - - -
    - -
    - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'groupDisplay' => $group['friendlyName'], - 'idx' => $key - )) : ''; ?> - - -
    - -
    None
    - - - -
    - - - -
    - element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> + + + + +
    + element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
    + + + +
    + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?>
    - - +

    @@ -145,4 +117,5 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; element('Components/subscriberList', array('addSubscribers' => false)); ?> + \ No newline at end of file diff --git a/webroot/js/collapse.js b/webroot/js/collapse.js new file mode 100644 index 0000000..2dc4d7c --- /dev/null +++ b/webroot/js/collapse.js @@ -0,0 +1,26 @@ +export default { + props: { + default: { + type: Boolean, + default: false + } + }, + components: { + }, + data() { + return { + collapsed: false, + } + }, + methods: { + toggle () { + this.collapsed = !this.collapsed; + } + }, + mounted() { + this.collapsed = this.default; + }, + template: /*html*/` + + ` +} \ No newline at end of file diff --git a/webroot/js/empty b/webroot/js/empty deleted file mode 100644 index e69de29..0000000 diff --git a/webroot/js/grouper-groups-view.js b/webroot/js/grouper-groups-view.js new file mode 100644 index 0000000..275178e --- /dev/null +++ b/webroot/js/grouper-groups-view.js @@ -0,0 +1,127 @@ +import Collapse from './collapse.js'; +import Popover from './popover.js'; + +export default { + props: { + groups: Object, + columns: Object, + config: Object, + action: { + type: String, + default: 'leave' + }, + url: String, + owner: Boolean, + txt: Object, + }, + components: { + Collapse + }, + computed: { + numColumns() { + return this.columns.length; + }, + collapsed() { + return this.config.collapsed; + } + }, + directives: { + Popover + }, + template: /*html*/` + + + + + + + + + + + + + + + + + + + + + + + + + +
    {{ column.label }}
    + +
    + +
    None
    + ` + } \ No newline at end of file diff --git a/webroot/js/popover.js b/webroot/js/popover.js new file mode 100644 index 0000000..68ac519 --- /dev/null +++ b/webroot/js/popover.js @@ -0,0 +1,10 @@ +export default { + mounted(el, { value }) { + jQuery(el).popover({ + content: value, + trigger: 'hover', + placement: 'top', + container: 'body' + }) + } +} \ No newline at end of file From 41f2ebef69ee4794f3a5ca7b433066a4d7954db6 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Wed, 8 Mar 2023 10:30:27 -0700 Subject: [PATCH 114/143] Implemented vuejs components --- Controller/GrouperGroupsController.php | 11 +- Lib/GrouperApiAccess.php | 2 +- Lib/lang.php | 4 +- View/Elements/Components/subscriberList.ctp | 8 - View/Elements/Components/vue-table.ctp | 118 +++++++++++++ View/GrouperGroups/base.ctp | 4 +- View/GrouperGroups/groupmember.ctp | 128 +++----------- View/GrouperGroups/groupoptin.ctp | 99 ++--------- View/GrouperGroups/groupowner.ctp | 125 +++---------- webroot/js/autocomplete.js | 59 +++++++ webroot/js/grouper-groups-view.js | 46 ++++- webroot/js/members.js | 186 ++++++++++++++++++++ webroot/js/search.js | 17 ++ 13 files changed, 490 insertions(+), 317 deletions(-) create mode 100644 View/Elements/Components/vue-table.ctp create mode 100644 webroot/js/autocomplete.js create mode 100644 webroot/js/members.js create mode 100644 webroot/js/search.js diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 14949aa..7859c04 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -65,6 +65,8 @@ public function beforeFilter() { parent::beforeFilter(); + $this->Security->unlockedActions = array('removeSubscriber', 'addSubscriber'); + //Need to find which plugin instance choosing, if more than one from cm_co_grouper_lites // table being used in COmanage. $grouperConnData = $this->Session->read('Plugin.Grouper.Api'); @@ -766,16 +768,16 @@ function isAuthorized() //TODO - This is needed for my dev enviro since I do not log in via I2 IdP // BEGIN =============================================== -// if ($this->Session->check('Auth.User.username')) { -// $this->userId = $this->Session->read('Auth.User.username'); -// } + if ($this->Session->check('Auth.User.username')) { + $this->userId = $this->Session->read('Auth.User.username'); + } // END =============================================== //TODO - Need to make the following code configurable in getting the user ID. In this case the code is // specific to the needs of I2. // BEGIN =============================================== - $uid=$this->Session->read('Auth.User.co_person_id'); + /*$uid=$this->Session->read('Auth.User.co_person_id'); $username=$this->Session->read('Auth.User.username'); error_log("HUBING ================ " . $username); @@ -815,6 +817,7 @@ function isAuthorized() $this->Session->write('Plugin.Grouper.UserId', $this->userId); } // END =============================================== + */ // Determine what operations this user can perform // Construct the permission set for this user, which will also be passed to the view. diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index d6b1d58..b9e2770 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -403,7 +403,7 @@ private function useMembershipUrl(array $queryData) { $groupType = $queryData['groupType']; $userId = $queryData['userId']; - + if ($groupType == 'optins' || $groupType == 'optouts') { $subjectId = "GrouperAll"; } elseif ($groupType == 'admin' || $groupType == 'update' || $groupType == 'stemAdmin') { diff --git a/Lib/lang.php b/Lib/lang.php index fb67713..cc33a8d 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -159,5 +159,7 @@ 'pl.grouperlite.attributes.zero-state' => 'No Attributes Associated to this Group.', 'pl.grouperlite.groups.zero-state' => 'No groups found.', 'pl.grouperlite.working-groups.zero-state' => 'None.', - 'pl.grouperlite.email-lists.zero-state' => 'No email lists found.' + 'pl.grouperlite.email-lists.zero-state' => 'No email lists found.', + 'pl.grouperlite.members.noaccess' => 'You do not have access to view memberships.', + 'pl.grouperlite.members.empty' => 'This group has no members.' ); \ No newline at end of file diff --git a/View/Elements/Components/subscriberList.ctp b/View/Elements/Components/subscriberList.ctp index 9ea20b9..100673e 100644 --- a/View/Elements/Components/subscriberList.ctp +++ b/View/Elements/Components/subscriberList.ctp @@ -140,20 +140,12 @@ $("#addUser").val(ui.item.identifier); // $("#CoGroupMemberCoPersonLabel").val(ui.item.label); $("#addUserbutton").prop('disabled', false).focus(); - $("#group-add-member-clear-button").show(); return false; }, - search: function(event, ui) { - $("#group-add-member-search-container .co-loading-mini").show(); - }, focus: function(event, ui) { event.preventDefault(); - $("#group-add-member-search-container .co-loading-mini").hide(); $("#group-add-member").val(ui.item.label + " (" + ui.item.value + ")"); }, - close: function(event, ui) { - $("#group-add-member-search-container .co-loading-mini").hide(); - } }).autocomplete("instance")._renderItem = formatCoPersonAutoselectItem; } diff --git a/View/Elements/Components/vue-table.ctp b/View/Elements/Components/vue-table.ctp new file mode 100644 index 0000000..337633b --- /dev/null +++ b/View/Elements/Components/vue-table.ctp @@ -0,0 +1,118 @@ + + + + +
    + element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
    + + + +
    + + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?> +
    diff --git a/View/GrouperGroups/base.ctp b/View/GrouperGroups/base.ctp index 3242b27..7ffa91f 100644 --- a/View/GrouperGroups/base.ctp +++ b/View/GrouperGroups/base.ctp @@ -1,5 +1,3 @@ - - Html->meta( @@ -23,7 +21,7 @@ print $this->Html->css('GrouperLite.co-grouper-plugin') . "\n "; print $this->Html->script('vue/vue-3.2.31.global.prod.js'); ?> - +element('GrouperLite.Components/plugins'); ?> Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => 'grouper_groups', 'action' => 'groupmember'), array('prepend' => true)); diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index ce7f61e..3d218f9 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -3,119 +3,31 @@ Html->addCrumb(_txt('pl.grouperlite.nav.memberships')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> - - - - - -
    - element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> -
    - - - -
    - - element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
    - +element('GrouperLite.Components/vue-table', array( + 'groupData' => json_encode(array( + 'adhoc' => $groupmemberships, + 'working' => $wgmemberships + )), + 'treatAsOwner' => $isuserowner === 'T' ? 'true' : 'false', + 'columns' => json_encode(array( + array('value' => 'name', 'label' => _txt('pl.grouperlite.table.name')), + array('value' => 'role', 'label' => _txt('pl.grouperlite.table.role')), + array('value' => 'description', 'label' => _txt('pl.grouperlite.table.description')), + array('value' => 'action', 'label' => _txt('pl.grouperlite.table.action')), + )), + 'collapsed' => $config['defaultCollapse'] === 'collapsed' ? true : false, + 'optAction' => "leavegroup", + 'actionUrl' => $this->Html->url([ + 'controller' => 'grouper_groups', 'action' => 'leavegroup' + ]), + 'members' => true, + 'addSubscribers' => true, +)); ?>

    -element('Components/subscriberList', array('addSubscribers' => false)); ?> - \ No newline at end of file diff --git a/View/GrouperGroups/groupoptin.ctp b/View/GrouperGroups/groupoptin.ctp index 3cb1144..8bc5a62 100644 --- a/View/GrouperGroups/groupoptin.ctp +++ b/View/GrouperGroups/groupoptin.ctp @@ -3,88 +3,25 @@ Html->addCrumb(_txt('pl.grouperlite.nav.groups-can-join')); ?> element('GrouperLite.Components/navigation-groups', array('active' => 'groupoptin')); ?> element('GrouperLite.Components/search', array('active' => 'groupoptin')); ?> - 'pl.grouperlite.table.name', - // 'role' => 'pl.grouperlite.table.role', - 'description' => 'pl.grouperlite.table.description', - 'action' => 'pl.grouperlite.table.action' -]; - -if ($isuserowner !== 'T') { - // array_splice($columns, 1, 1); -} - -$numColumns = count($columns); - -$collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; - -?> - 0) : ?> -
    - element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - $label) : ?> - - - - - - - - - $group) : ?> - - - - - - - - -
    - -
    - - - - - element('GrouperLite.Components/optAction', array( - 'member' => false, - 'action' => 'joingroup', - 'group' => $group['name'], - 'groupDisplay' => $group['friendlyName'], - 'idx' => $key - )); ?> -
    - element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
    - - +element('GrouperLite.Components/vue-table', array( + 'groupData' => json_encode(array( + 'adhoc' => $groupoptins, + 'working' => array() + )), + 'treatAsOwner' => false, + 'columns' => json_encode(array( + array('value' => 'name', 'label' => _txt('pl.grouperlite.table.name')), + array('value' => 'description', 'label' => _txt('pl.grouperlite.table.description')), + array('value' => 'action', 'label' => _txt('pl.grouperlite.table.action')), + )), + 'collapsed' => $config['defaultCollapse'] === 'collapsed' ? true : false, + 'optAction' => "joingroup", + 'actionUrl' => $this->Html->url([ + 'controller' => 'grouper_groups', 'action' => 'joingroup' + ]), +)); ?>

    - - \ No newline at end of file + \ No newline at end of file diff --git a/View/GrouperGroups/groupowner.ctp b/View/GrouperGroups/groupowner.ctp index 63176bd..6751105 100644 --- a/View/GrouperGroups/groupowner.ctp +++ b/View/GrouperGroups/groupowner.ctp @@ -4,117 +4,38 @@ element('Components/navigation-groups', array('active' => 'groupowner')); ?> element('Components/search', array('active' => 'groupowner')); ?> 'pl.grouperlite.table.name', - 'role' => 'pl.grouperlite.table.role', - 'description' => 'pl.grouperlite.table.description', - 'status' => 'pl.grouperlite.table.status', - 'action' => 'pl.grouperlite.table.action' -]; +$columns = array( + array('value' => 'name', 'label' => _txt('pl.grouperlite.table.name')), + array('value' => 'role', 'label' => _txt('pl.grouperlite.table.role')), + array('value' => 'description', 'label' => _txt('pl.grouperlite.table.description')), + array('value' => 'status', 'label' => _txt('pl.grouperlite.table.status')), + array('value' => 'action', 'label' => _txt('pl.grouperlite.table.action')), +); if ($isuserowner !== 'T') { array_splice($columns, 1, 1); } +?> + +element('GrouperLite.Components/vue-table', array( + 'groupData' => json_encode(array( + 'adhoc' => $groupsowners, + 'working' => array() + )), + 'treatAsOwner' => $isuserowner === 'T' ? 'true' : 'false', + 'columns' => json_encode($columns), + 'collapsed' => $config['defaultCollapse'] === 'collapsed' ? true : false, + 'optAction' => "leavegroup", + 'actionUrl' => $this->Html->url([ + 'controller' => 'grouper_groups', 'action' => 'leavegroup' + ]), + 'members' => true +)); ?> -$numColumns = count($columns); -$collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; -?> - 0) : ?> -
    - element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - $label) : ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - You are not a manager of any ad-hoc groups. -
    - - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'groupDisplay' => $group['friendlyName'], - 'idx' => $key - )) : ''; ?> - - - - -   - - - - -
    - element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
    - -

    -element('Components/subscriberList', array('addSubscribers' => true)); ?> \ No newline at end of file diff --git a/webroot/js/autocomplete.js b/webroot/js/autocomplete.js new file mode 100644 index 0000000..f7a161d --- /dev/null +++ b/webroot/js/autocomplete.js @@ -0,0 +1,59 @@ +// ns.testeradmin@at.internet2.edu + +export default { + props: { + group: String + }, + inject: ['txt', 'api'], + data() { + return { + search: '', + test: [{ + "value": "8", + "label": "Susan S. Singularity", + "email": "ssingularity@another.org 1", + "emailLabel": "Email (official): ", + "identifier": "ssingularity@another.org", + "identifierLabel": "" + }, { + "value": "4", + "label": "Susan S. Susanity", + "email": "ssusanity@newbie.org 1", + "emailLabel": "Email (official): ", + "identifier": "ssingularity@another.org", + "identifierLabel": "" + }] + }; + }, + methods: { + addUser(search) { + this.$emit('add', search); + } + }, + mounted(el) { + const input = $(this.$el).find('#add-user-input'); + input.autocomplete({ + source: `${this.api.find}?co=${this.api.co}&mode=${this.api.mode}`, + // source: [].concat(this.test, this.test, this.test), + minLength: 3, + maxShowItems: 5, + select: (event, ui) => { + console.log(ui); + $("#add-user-input").val(ui.item.value); + $("#addUserbutton").prop('disabled', false).focus(); + return false; + }, + }); + }, + template: /*html*/` +
    + +
    + +
    +
    + ` +} \ No newline at end of file diff --git a/webroot/js/grouper-groups-view.js b/webroot/js/grouper-groups-view.js index 275178e..7920461 100644 --- a/webroot/js/grouper-groups-view.js +++ b/webroot/js/grouper-groups-view.js @@ -1,5 +1,6 @@ import Collapse from './collapse.js'; import Popover from './popover.js'; +import Members from './members.js'; export default { props: { @@ -12,10 +13,12 @@ export default { }, url: String, owner: Boolean, - txt: Object, + grouper: String, }, + inject: ['txt'], components: { - Collapse + Collapse, + Members }, computed: { numColumns() { @@ -23,12 +26,24 @@ export default { }, collapsed() { return this.config.collapsed; + }, + role() { + return this.columns.some(c => c.value === 'role'); + }, + status() { + return this.columns.some(c => c.value === 'status'); } }, directives: { Popover }, + methods: { + showSubscribers(group) { + this.$refs.members.show(group); + } + }, template: /*html*/` + @@ -58,23 +73,36 @@ export default { + + - + -
    {{ group.description || txt.descrZeroState }}{{ group.enabled && group.enabled === 'T' ? 'Enabled' : 'Disabled' }} - -
    @@ -88,10 +116,10 @@ export default {
    None