Verified Commit 67bdaea9 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(Reminder) - adds a way to use force_ids with lsc

Adds a method to use force_ids with lsc logic.
Showing with 32 additions and 0 deletions
+32 -0
...@@ -691,6 +691,10 @@ class fdRPCService ...@@ -691,6 +691,10 @@ class fdRPCService
$this->checkAccess($type, NULL, $dn); $this->checkAccess($type, NULL, $dn);
$template = new template($type, $dn); $template = new template($type, $dn);
// We have to re-order posix classes'attributes to take into consideration force_ids correctly.
$values = $this->posixArrayReordering($values);
$error = $template->deserialize($values); $error = $template->deserialize($values);
if ($error !== TRUE) { if ($error !== TRUE) {
throw new WebServiceError($error); throw new WebServiceError($error);
...@@ -1012,4 +1016,32 @@ class fdRPCService ...@@ -1012,4 +1016,32 @@ class fdRPCService
global $config; global $config;
return $config->current['BASE']; return $config->current['BASE'];
} }
/**
* @param $values
* @return array
* NOTE : A simple iteration of the posix array received to re-order force_ids as primary key.
* This is to fix an issue with LSC not able to force IDS to true as other attributes can be processed first.
*/
private function posixArrayReordering ($values) : array
{
$result = $values;
if (!empty($values['posixAccount'])) {
if (!empty($values['posixAccount']['force_ids'])) {
// Reorder array with 'force_ids' as the first key
$array = array_merge(
['force_ids' => $values['posixAccount']['force_ids']],
$values['posixAccount']
);
// Update $values['posixAccount'] with reordered array
$values['posixAccount'] = $array;
$result = $values;
}
}
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