From 3a5a7e6c123c5b3e28022e844a177d2fc278782f Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Thu, 21 Jan 2021 19:18:03 -0400 Subject: [PATCH] PMCORE-773 Ldap> OU for retired Employees> The state is not changed to inactive after executing cron. --- workflow/engine/classes/LdapAdvanced.php | 5 ++++- workflow/engine/methods/services/ldapadvanced.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/LdapAdvanced.php b/workflow/engine/classes/LdapAdvanced.php index 07f0fcdf4..33408d504 100644 --- a/workflow/engine/classes/LdapAdvanced.php +++ b/workflow/engine/classes/LdapAdvanced.php @@ -1889,7 +1889,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();