From 77cc7305804955d5f949f95a03895e646bc96079 Mon Sep 17 00:00:00 2001 From: Benn Oshrin Date: Wed, 5 May 2021 19:35:25 -0400 Subject: [PATCH] Additional commit for CO-583 --- .../Model/CoApiProvisionerTarget.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/AvailablePlugin/ApiProvisioner/Model/CoApiProvisionerTarget.php b/app/AvailablePlugin/ApiProvisioner/Model/CoApiProvisionerTarget.php index 3e0a05dfc..34de3e9fd 100644 --- a/app/AvailablePlugin/ApiProvisioner/Model/CoApiProvisionerTarget.php +++ b/app/AvailablePlugin/ApiProvisioner/Model/CoApiProvisionerTarget.php @@ -115,7 +115,8 @@ public function provision($coProvisioningTargetData, $op, $provisioningData) { case ProvisioningActionEnum::CoGroupAdded: case ProvisioningActionEnum::CoGroupUpdated: case ProvisioningActionEnum::CoGroupReprovisionRequested: - $syncGroup = true; + // We don't currently support groups + //$syncGroup = true; break; case ProvisioningActionEnum::CoGroupDeleted: $deleteGroup = true; @@ -181,8 +182,7 @@ public function provision($coProvisioningTargetData, $op, $provisioningData) { } if($deletePerson) { - $this->deletePerson($coProvisioningTargetData['CoApiProvisionerTarget']['co_provisioning_target_id'], - $coProvisioningTargetData['CoApiProvisionerTarget']['username_type'], + $this->deletePerson($coProvisioningTargetData['CoApiProvisionerTarget'], $provisioningData['CoPerson']['id'], $provisioningData['Identifier']); } @@ -190,7 +190,7 @@ public function provision($coProvisioningTargetData, $op, $provisioningData) { if($syncGroup) { $this->syncGroup($coProvisioningTargetData['CoApiProvisionerTarget']['co_provisioning_target_id'], $provisioningData['CoGroup'], - $coProvisioningTargetData['CoApiProvisionerTarget']['username_type']); + $coProvisioningTargetData['CoApiProvisionerTarget']['identifier_type']); } if($syncPerson) { @@ -216,22 +216,20 @@ protected function deleteGroup($coGroup) { * Delete a CO Person. * * @since COmanage Registry v4.0.0 - * @param Integer $coProvisioningTargetId CoProvisioningTarget ID - * @param IdentifierEnum $usernameType Username type + * @param array $coApiProvisionerTarget CoApiProvisioningTarget * @param Integer $coPersonId CoPerson ID * @param Array $identifiers Array of person's identifiers * @return boolean true * @throws RuntimeException */ - protected function deletePerson($coProvisioningTargetId, - $usernameType, + protected function deletePerson($coApiProvisionerTarget, $coPersonId, $identifiers) { // Find the identifier of the requested identifier type // Note similar logic in deletePerson - $identifierType = $coProvisioningTarget['identifier_type']; + $identifierType = $coApiProvisionerTarget['identifier_type']; $identifier = null; $ids = Hash::extract($identifiers, '{n}[type='.$identifierType.']'); @@ -255,7 +253,7 @@ protected function deletePerson($coProvisioningTargetId, ) ); - switch($coProvisioningTarget['mode']) { + switch($coApiProvisionerTarget['mode']) { case ApiProvisionerModeEnum::POST: $response = $this->Http->post("/", json_encode($message)); break;