You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Console/Commands/LdapSync.php
+3-10Lines changed: 3 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -221,12 +221,11 @@ private function updateCreateUser(AdldapUser $snipeUser): void
221
221
*
222
222
* @since 5.0.0
223
223
*
224
-
* @param int $page The page to get the result set
225
224
*/
226
-
privatefunctionprocessLdapUsers(int$page=0): void
225
+
privatefunctionprocessLdapUsers(): void
227
226
{
228
227
try {
229
-
$ldapUsers = $this->ldap->getLdapUsers($page);
228
+
$ldapUsers = $this->ldap->getLdapUsers();
230
229
} catch (Exception$e) {
231
230
$this->outputError($e);
232
231
exit($e->getMessage());
@@ -242,15 +241,9 @@ private function processLdapUsers(int $page=0): void
242
241
}
243
242
244
243
// Process each individual users
245
-
foreach ($ldapUsersas$user) {
244
+
foreach ($ldapUsers->getResults()as$user) {// AdLdap2's paginate() method is weird, it gets *everything* and ->getResults() returns *everything*
246
245
$this->updateCreateUser($user);
247
246
}
248
-
249
-
if ($ldapUsers->getCurrentPage() < $ldapUsers->getPages()-1) {
250
-
$current_page = $ldapUsers->getCurrentPage();
251
-
unset($ldapUsers); //deliberately unset the variable so we don't OOM
252
-
$this->processLdapUsers($current_page + 1); //this recursive call means that the $ldapUsers variable is not going to get GC'ed until everything returns. Blech.
0 commit comments