diff --git a/workflow/engine/classes/LdapAdvanced.php b/workflow/engine/classes/LdapAdvanced.php index 0089fac73..94691ea15 100644 --- a/workflow/engine/classes/LdapAdvanced.php +++ b/workflow/engine/classes/LdapAdvanced.php @@ -1891,7 +1891,10 @@ class LdapAdvanced do { $aAttr = $this->ldapGetAttributes($ldapcnn, $oEntry); - $aUsers[] = $this->ldapGetUsersFromDepartment("GET", $aAttr["dn"]); + $result = $this->ldapGetUsersFromDepartment("GET", $aAttr["dn"]); + foreach ($result as $item) { + $aUsers[] = $item; + } } while ($oEntry = ldap_next_entry($ldapcnn, $oEntry)); } } diff --git a/workflow/engine/methods/services/ldapadvanced.php b/workflow/engine/methods/services/ldapadvanced.php index 142f1232f..fea43a878 100644 --- a/workflow/engine/methods/services/ldapadvanced.php +++ b/workflow/engine/methods/services/ldapadvanced.php @@ -111,7 +111,6 @@ class ldapadvancedClassCron //Get all users from Removed OU $this->usersRemovedOu = $plugin->getUsersFromRemovedOu($arrayAuthenticationSourceData); - $plugin->deactiveArrayOfUsers($this->usersRemovedOu); //Variables $this->deletedRemoved = count($this->usersRemovedOu); @@ -427,6 +426,7 @@ class ldapadvancedClassCron //Update Users data based on the LDAP Server $plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]); + $plugin->deactiveArrayOfUsers($this->usersRemovedOu); } catch (Exception $e) { $plugin = new LdapAdvanced(); $message = $e->getMessage();