From 838a0988203a96a4c6ad76abd6f57cd0e0f3f75a Mon Sep 17 00:00:00 2001 From: axman Date: Tue, 23 Mar 2021 08:31:33 -0700 Subject: [PATCH 01/11] WIP --- Controller/GrouperGroupsController.php | 52 +++++++++--- Lib/GrouperApiAccess.php | 79 +++++++++++++++---- Model/GrouperGroup.php | 49 +++++++++--- View/GrouperGroups/groupcreate.ctp | 36 ++++++++- View/GrouperGroups/groupcreateform.ctp | 30 ------- ...mplateform.ctp => groupcreatetemplate.ctp} | 0 View/GrouperGroups/groupfields.inc | 6 +- 7 files changed, 180 insertions(+), 72 deletions(-) delete mode 100644 View/GrouperGroups/groupcreateform.ctp rename View/GrouperGroups/{groupcreatetemplateform.ctp => groupcreatetemplate.ctp} (100%) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 4dd3f1f..c52e6c7 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -337,9 +337,9 @@ public function groupOptin() { * Editing via a template will not be supported in this version of the plugin - Bill Kaufman * */ - public function groupCreateTemplateForm() { + public function groupCreateTemplate() { if ($this->request->is('post')){ - if(!$this->GrouperGroup->createGroupFromTemplate($this->userId, $this->request->data)){ + if(!$this->GrouperGroup->createGroupWithTemplate($this->userId, $this->request->data)){ $this->Flash->set("Error in creating group!", array('key' => 'error')); return $this->redirect(array('action' => 'groupoptin')); } @@ -347,21 +347,49 @@ public function groupCreateTemplateForm() { $this->set('title', _txt('pl.grouperlite.title.templatecreate')); } + /** + * Delete a Grouper Group via Grouper Template + * + */ + public function groupDeleteTemplate() { + if(!$this->GrouperGroup->deleteGroupWithTemplate($this->userId, $this->request->data)){ + $this->Flash->set("Error in deleting group!", array('key' => 'error')); + return $this->redirect(array('action' => 'groupoptin')); + } + + $this->set('title', _txt('pl.grouperlite.title.templatecreate')); + } + + + public function groupCreate() { + if ($this->request->is('post')){ + if(!$this->GrouperGroup->createUpdateGroup($this->userId, $this->request->data)){ + $this->Flash->set("Error in creating group!", array('key' => 'error')); + return $this->redirect(array('action' => 'groupOwner')); + } else { + $this->Flash->set("Your Group has been created!", array('key' => 'success')); + return $this->redirect(array('action' => 'groupOwner')); + } + } - //TODO - Need to combine this form with code below for groupCreate - public function groupCreateForm() { $this->set('title', _txt('pl.grouperlite.title.groupcreate')); $this->set('grouperstems', $this->GrouperGroup->getOwnedStems($this->userId)); } - public function groupCreate() { - $name = urldecode($this->request->data['name']); - $set = urldecode($this->request->data['set']); - $descr = urldecode($this->request->data['description']); - // Debugger::dump($this->request->data); - $this->set('groupergroupadded', $this->GrouperGroup->createGroup($this->userId, $name, $set, $descr)); + //TODO - Finish this call + public function groupDelete() { + if(!$this->GrouperGroup->deleteGroup($this->userId, $this->request->data)){ + $this->Flash->set("Error in deleting group!", array('key' => 'error')); + return $this->redirect(array('action' => 'groupOwner')); + } else { + $this->Flash->set("Your Group has been deleted!", array('key' => 'success')); + return $this->redirect(array('action' => 'groupOwner')); + } + + $this->set('grouperstems', $this->GrouperGroup->getOwnedStems($this->userId)); } + /** * Process to join a group displayed on the "Optin" page * @@ -451,11 +479,11 @@ function isAuthorized() { $p['emaillistsmember'] = true; $p['emaillistsmanage'] = true; $p['emaillistsinfo'] = true; - $p['groupcreateform'] = true; $p['groupcreate'] = true; + $p['groupdelete'] = true; $p['joingroup'] = true; $p['leavegroup'] = true; - $p['groupcreatetemplateform'] = true; + $p['groupcreatetemplate'] = true; $this->set('permissions', $p); diff --git a/Lib/GrouperApiAccess.php b/Lib/GrouperApiAccess.php index 87d1de4..92a067c 100644 --- a/Lib/GrouperApiAccess.php +++ b/Lib/GrouperApiAccess.php @@ -395,20 +395,19 @@ public function getGrouperGroupDescription(array $queryData) { } /** - * Method used to create a new Group in Grouper via the Template method. + * Method used to CREATE a new Group in Grouper via the Template method. * * @param array $queryData Array of conditions and data adding new Grouper Group * @return bool True if added successfully * @throws GrouperLiteException * */ - public function createGroupFromTemplate(array $queryData) { + public function createGroupWithTemplate(array $queryData) { //Currently only supporting create group, need to test if update a group will work! $data = $queryData['data']; $userId = $queryData['userId']; - //Build request logic $inputFields = array(); foreach($data as $key => $value) { @@ -430,9 +429,56 @@ public function createGroupFromTemplate(array $queryData) { ) ); - echo json_encode($groupToSave); - exit(); - //TODO - take out exit and finish by running an example through + $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); + $connectionUrl = "{$this->config['fullUrl']}/gshTemplateExec"; + + try { + $results = $this->http->sendRequest('POST', $connectionUrl, json_encode($groupToSave)); + + if (isset($results['WsGshTemplateExecResult']['resultMetadata']['resultCode'])) { + if (stripos($results['WsGshTemplateExecResult']['resultMetadata']['resultCode'], "SUCCESS", 0) !== false) { + return true; + } + } + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; + } + return false; + } + + /** + * Method used to DELETE a Group in Grouper via the Template method. + * + * @param array $queryData Array of conditions and data adding new Grouper Group + * @return bool True if deleted successfully + * @throws GrouperLiteException + * + */ + public function deleteGroupWithTemplate(array $queryData) { + + $workingGroupExt = $queryData['workingGroupExt']; + $userId = $queryData['userId']; + + $groupToDelete = array( + "WsRestGshTemplateExecRequest" => array( + "gshTemplateActAsSubjectLookup" => array( + "subjectSourceId" => "ldap", + "subjectId" => $userId + ), + "ownerStemLookup" => array( + "stemName" => "ref:incommon-collab" + ), + "ownerType" => "stem", + "configId" => "createNewWorkingGroup", + "inputs" => array( + array( + "name" => "gsh_input_workingGroupExtension", + "value" => $workingGroupExt + ) + ) + ) + ); $this->http->setHeader(array('Content-Type' => 'application/json', 'Accept' => 'application/json')); $connectionUrl = "{$this->config['fullUrl']}/gshTemplateExec"; @@ -453,7 +499,7 @@ public function createGroupFromTemplate(array $queryData) { } /** - * NOTE: This will probably changes once templates become available to use + * For creating/updating Ad-Hoc groups not using the Grouper Template format * * Create or Update a Group where User is Admin/Owner * @@ -462,15 +508,19 @@ public function createGroupFromTemplate(array $queryData) { * @throws GrouperLiteException */ public function createUpdateGroup(array $queryData) { - //TODO - Need to add checking for missing ':' - //Currently only supporting create group, need to test if update a group will work! + //TODO Currently only supporting create group, need to test if update a group will work! - $groupName = $queryData['groupName']; - $stemName = $queryData['stemName']; + $groupName = htmlentities($queryData['name']); + $stemName = htmlentities($queryData['stem']); $userId = $queryData['userId']; - $groupDescription = $queryData['groupDescription']; + $groupDescription = htmlentities($queryData['description']); + $privileges = $queryData['privileges']; + + //Group name may be in "friendly" format, so need to do some small conversions before saving. + $newGroupName = ucfirst(strtolower($groupName)); + $newGroupName = str_replace(' ', '', $newGroupName); - $newGroupToSave = $stemName . $groupName; + $newGroupToSave = "$stemName:$newGroupName"; //Build request logic $groupToSave = array( @@ -482,7 +532,8 @@ public function createUpdateGroup(array $queryData) { array( "wsGroup" => array( "description" => $groupDescription, - "name" => $newGroupToSave + "name" => $newGroupToSave, + "displayExtension" => $groupName ), "wsGroupLookup" => array( "groupName" => $groupDescription diff --git a/Model/GrouperGroup.php b/Model/GrouperGroup.php index e8d14e2..e4f5995 100644 --- a/Model/GrouperGroup.php +++ b/Model/GrouperGroup.php @@ -47,6 +47,7 @@ class GrouperGroup extends GrouperLiteAppModel /** @var string Group whose members can create Groups via Template process*/ private $templateCreationGroup = 'ref:workinggroupadmins'; + /** * Verifies if user is an owner/admin of a group and then stores results in Session. * Session variable is reset on Group Creation and Group Deletion @@ -84,6 +85,7 @@ public function isUserOwner(string $userId) { } } + /** * Used to instantiate API class * @@ -413,7 +415,7 @@ public function isTemplateUser(string $userId) { * @throws GrouperLiteException * */ - public function createGroupFromTemplate(string $userId, array $groupData) { + public function createGroupWithTemplate(string $userId, array $groupData) { $this->initApi(); try { @@ -437,7 +439,7 @@ public function createGroupFromTemplate(string $userId, array $groupData) { // Reset Session variable that shows if User is an owner or not $this->resetUserOwner(); - return $this->grouperAPI->createGroupFromTemplate($args); + return $this->grouperAPI->createGroupWithTemplate($args); } catch (Exception $e) { CakeLog::write('error', __METHOD__ . ': An error occurred'); @@ -447,26 +449,49 @@ public function createGroupFromTemplate(string $userId, array $groupData) { } /** - * Creates a new Grouper Group + * Delete a Grouper Group using the Template methodology in Grouper + * + * @param string $userId Id of User + * @param array $groupData Data needed to delete a Grouper Group via Template + * @return bool True if successfully deleted record + * @throws GrouperLiteException + * + */ + public function deleteGroupWithTemplate(string $userId, array $groupData) { + $this->initApi(); + + try { + $args = array(); + $args['userId'] = $userId; + $args['workingGroupExt'] = $groupData['workingGroupExt']; + + // Reset Session variable that shows if User is an owner or not + $this->resetUserOwner(); + + return $this->grouperAPI->deleteGroupWithTemplate($args); + + } catch (Exception $e) { + CakeLog::write('error', __METHOD__ . ': An error occurred'); + throw $e; + } + + } + + /** + * Creates/Updates a new Grouper Group not Template related * * @param string $userId Id of user - * @param string $groupName Display Name of Group creating, do not confuse with Name field that is ID! - * @param string $stemName Full Stem (Folder) Name in format of 'stem:substem:subsubstem' - * @param string $groupDesc Description of Group creating + * @param array $data Data from form to Save in Grouper as a Group * @return bool True if saved | False if already created * @throws GrouperLiteException * */ - public function createGroup(string $userId, string $groupName, string $stemName, string $groupDesc) { + public function createUpdateGroup(string $userId, array $data) { $this->initApi(); try { - $args = array(); - $args['groupType'] = 'Optins'; + $args = $data; $args['userId'] = $userId; - $args['groupName'] = $groupName; - $args['stemName'] = $stemName; - $args['groupDescription'] = $groupDesc; // Reset Session variable that shows if User is an owner or not $this->resetUserOwner(); diff --git a/View/GrouperGroups/groupcreate.ctp b/View/GrouperGroups/groupcreate.ctp index 15df446..c3bf238 100644 --- a/View/GrouperGroups/groupcreate.ctp +++ b/View/GrouperGroups/groupcreate.ctp @@ -1 +1,35 @@ -Group Created! \ No newline at end of file +extend('/GrouperGroups/base'); +$this->Html->addCrumb('Create a Group'); + +$model = $this->name; +?> +
+
+
+
+
+
Stems coming in are: Id=stem
+ +
Value= Display=
+ + + Form->create(false, array( + 'url' => array('controller' => 'groupergroups', 'action' => 'groupcreate') + )); ?> + plugin)) { + if (file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { + include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); + } elseif (file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { + include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); + } + } else { + include(APP . "View/" . $model . "/groupfields.inc"); + } + ?> + Form->end(); ?> +
+
+
+
\ No newline at end of file diff --git a/View/GrouperGroups/groupcreateform.ctp b/View/GrouperGroups/groupcreateform.ctp deleted file mode 100644 index c633d0f..0000000 --- a/View/GrouperGroups/groupcreateform.ctp +++ /dev/null @@ -1,30 +0,0 @@ -extend('/GrouperGroups/base'); -$this->Html->addCrumb('Create a Group'); - -$model = $this->name; -?> -
-
-
-
-
- Form->create(false, array( - 'url' => array('controller' => 'groupergroups', 'action' => 'groupcreate') - )); ?> - plugin)) { - if (file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { - include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); - } elseif (file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { - include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); - } - } else { - include(APP . "View/" . $model . "/groupfields.inc"); - } - ?> - Form->end(); ?> -
-
-
-
\ No newline at end of file diff --git a/View/GrouperGroups/groupcreatetemplateform.ctp b/View/GrouperGroups/groupcreatetemplate.ctp similarity index 100% rename from View/GrouperGroups/groupcreatetemplateform.ctp rename to View/GrouperGroups/groupcreatetemplate.ctp diff --git a/View/GrouperGroups/groupfields.inc b/View/GrouperGroups/groupfields.inc index b826cf9..72e6171 100644 --- a/View/GrouperGroups/groupfields.inc +++ b/View/GrouperGroups/groupfields.inc @@ -1,5 +1,5 @@ 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 10/11] 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 11/11] 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.