Commit b5557b9b authored by dockx thibault's avatar dockx thibault
Browse files

Merge branch '6307-core-supann-life-cycle-automation-via-orchestrator-4' into 'dev'

Resolve "[CORE] - Supann life cycle - automation via Orchestrator"

See merge request fusiondirectory/fd!1064
Showing with 17 additions and 10 deletions
+17 -10
...@@ -148,9 +148,15 @@ class tasks extends simplePlugin ...@@ -148,9 +148,15 @@ class tasks extends simplePlugin
if (!empty($subTasks)) { if (!empty($subTasks)) {
// Recuperate members DN from the ldap search. // Recuperate members DN from the ldap search.
foreach ($subTasks as $subTask) { foreach ($subTasks as $subTask) {
// Case of a DN passed but being locked.
if (!empty($subTask['fdTasksGranularDN'][0])) { // For lifeCycle we check DN and for mailObject we check mail
$membersDN[] = $subTask['fdTasksGranularDN'][0]; switch ($attributeType) {
case 'fdTasksGranularDN':
$membersDN[] = $subTask['fdTasksGranularDN'][0];
break;
case 'fdTasksGranularMail':
$membersDN[] = $subTask['fdTasksGranularMail'][0];
break;
} }
} }
// Verify the DN differences and only keep those. // Verify the DN differences and only keep those.
...@@ -186,7 +192,7 @@ class tasks extends simplePlugin ...@@ -186,7 +192,7 @@ class tasks extends simplePlugin
"fdTasksGranularMailBCC" => $attrs['bcc'] "fdTasksGranularMailBCC" => $attrs['bcc']
]; ];
break; break;
case 'fdTasksLifeCycle' : case 'fdTasksGranularDN' :
$prepData['tasksGranular'] = [ $prepData['tasksGranular'] = [
"fdTasksGranularDN" => $dn, "fdTasksGranularDN" => $dn,
"fdTasksGranularType" => 'Life Cycle', "fdTasksGranularType" => 'Life Cycle',
...@@ -257,12 +263,12 @@ class tasks extends simplePlugin ...@@ -257,12 +263,12 @@ class tasks extends simplePlugin
$listMemberDN[] = $memberDN; $listMemberDN[] = $memberDN;
} }
// case of member not within a group or dyngroup // case of member not within a group or dyngroup
} else {
$listMemberDN[] = $group; //Here group is indeed a sole user
} }
// Make sure no duplicate can happens, case of same member in an existing group. } else {
$listMemberDN = array_unique($listMemberDN); $listMemberDN[] = $group; //Here group is indeed a sole user
} }
// Make sure no duplicate can happens, case of same member in an existing group.
$listMemberDN = array_unique($listMemberDN);
} }
// Iterate on the DN list to remove any members representing a group (members of that potential groups were extracted). // Iterate on the DN list to remove any members representing a group (members of that potential groups were extracted).
......
...@@ -186,8 +186,9 @@ class tasksLifeCycle extends simplePlugin ...@@ -186,8 +186,9 @@ class tasksLifeCycle extends simplePlugin
*/ */
public function generateSlaveTasks () public function generateSlaveTasks ()
{ {
$listOfDN = $this->attributesAccess['fdTasksLifeCycleListOfDN']->getValue(); $listOfDN = $this->attributesAccess['fdTasksLifeCycleListOfDN']->getValue();
$attributeType = 'fdTasksLifeCycle'; // The attribute required to be search in createSlaveTasks
$attributeType = 'fdTasksGranularDN';
// Call the method from parent tasks object (first tab) to create sub-tasks. // Call the method from parent tasks object (first tab) to create sub-tasks.
$this->parent->getBaseObject()->createSlaveTasks($listOfDN, $attributeType); $this->parent->getBaseObject()->createSlaveTasks($listOfDN, $attributeType);
......
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