Verified Commit 5ca9c13f authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(Orchestrator) - small code fixes

Small code fixes.
Showing with 6 additions and 6 deletions
+6 -6
...@@ -123,26 +123,26 @@ class Notifications implements EndpointInterface ...@@ -123,26 +123,26 @@ class Notifications implements EndpointInterface
return $result; return $result;
} }
private function verifySupannState (array $supannResource, string $uid) : bool private function verifySupannState (array $supannResource, string $uid): bool
{ {
$result = false; $result = FALSE;
// search the supannStates for the targeted uid by reusing getLdapTasks logic // search the supannStates for the targeted uid by reusing getLdapTasks logic
$uidSupannStates = $this->gateway->getLdapTasks('(objectClass=supannPerson)', ['supannRessourceEtat'], '', $uid); $uidSupannStates = $this->gateway->getLdapTasks('(objectClass=supannPerson)', ['supannRessourceEtat'], '', $uid);
$this->gateway->unsetCountKeys($uidSupannStates); $this->gateway->unsetCountKeys($uidSupannStates);
//Construct Supann Resource State as string //Construct Supann Resource State as string
if (!empty($supannResource['subState'][0])) { if (!empty($supannResource['subState'][0])) {
$monitoredSupannState = '{'.$supannResource['resource'][0].'}'.$supannResource['state'][0].':'.$supannResource['subState'][0]; $monitoredSupannState = '{' . $supannResource['resource'][0] . '}' . $supannResource['state'][0] . ':' . $supannResource['subState'][0];
} else { } else {
$monitoredSupannState = '{'.$supannResource['resource'][0].'}'.$supannResource['state'][0]; $monitoredSupannState = '{' . $supannResource['resource'][0] . '}' . $supannResource['state'][0];
} }
foreach ($uidSupannStates[0]['supannressourceetat'] as $supannResource) { foreach ($uidSupannStates[0]['supannressourceetat'] as $supannResource) {
if ($supannResource === $monitoredSupannState) { if ($supannResource === $monitoredSupannState) {
$result = true; $result = TRUE;
} }
} }
return $result; return $result;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment