Skip to content

Commit

Permalink
Additional commit for CO-583
Browse files Browse the repository at this point in the history
  • Loading branch information
boshrin committed May 5, 2021
1 parent 724cbab commit 77cc730
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -181,16 +182,15 @@ 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']);
}

if($syncGroup) {
$this->syncGroup($coProvisioningTargetData['CoApiProvisionerTarget']['co_provisioning_target_id'],
$provisioningData['CoGroup'],
$coProvisioningTargetData['CoApiProvisionerTarget']['username_type']);
$coProvisioningTargetData['CoApiProvisionerTarget']['identifier_type']);
}

if($syncPerson) {
Expand All @@ -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.']');
Expand All @@ -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;
Expand Down

0 comments on commit 77cc730

Please sign in to comment.