From cce0739bb7715b27fd92227c8942ca7f30c516fc Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Mon, 26 Oct 2020 12:53:45 -0700 Subject: [PATCH 1/2] Clean up AdLdap2 integration to better handle paged result-sets --- app/Console/Commands/LdapSync.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/LdapSync.php b/app/Console/Commands/LdapSync.php index 57baaa83b0..94ed764a80 100644 --- a/app/Console/Commands/LdapSync.php +++ b/app/Console/Commands/LdapSync.php @@ -221,12 +221,11 @@ class LdapSync extends Command * * @since 5.0.0 * - * @param int $page The page to get the result set */ - private function processLdapUsers(int $page=0): void + private function processLdapUsers(): void { try { - $ldapUsers = $this->ldap->getLdapUsers($page); + $ldapUsers = $this->ldap->getLdapUsers(); } catch (Exception $e) { $this->outputError($e); exit($e->getMessage()); @@ -242,15 +241,9 @@ class LdapSync extends Command } // Process each individual users - foreach ($ldapUsers as $user) { + foreach ($ldapUsers->getResults() as $user) { // AdLdap2's paginate() method is weird, it gets *everything* and ->getResults() returns *everything* $this->updateCreateUser($user); } - - if ($ldapUsers->getCurrentPage() < $ldapUsers->getPages()-1) { - $current_page = $ldapUsers->getCurrentPage(); - unset($ldapUsers); //deliberately unset the variable so we don't OOM - $this->processLdapUsers($current_page + 1); //this recursive call means that the $ldapUsers variable is not going to get GC'ed until everything returns. Blech. - } } /** From 7937258f6ea69b62ffbc13ee79658131b845433e Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 26 Oct 2020 14:24:19 -0700 Subject: [PATCH 2/2] Bumped version --- config/version.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/version.php b/config/version.php index a3f4766528..7a7d8682ff 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v5.0.3', - 'full_app_version' => 'v5.0.3 - build 5443-g5f8221470', - 'build_version' => '5443', + 'app_version' => 'v5.0.4', + 'full_app_version' => 'v5.0.4 - build 5452-gc93f4ef0d', + 'build_version' => '5452', 'prerelease_version' => '', - 'hash_version' => 'g5f8221470', - 'full_hash' => 'v5.0.2-27-g5f8221470', + 'hash_version' => 'gc93f4ef0d', + 'full_hash' => 'v5.0.4-7-gc93f4ef0d', 'branch' => 'develop', ); \ No newline at end of file