This file describes an error we have discovered while researching the DeskPro application.
When the LDAP plugin runs, it querys the LDAP server to fetch a list of all users objects.
The PHP application loops through all of the records, and then processes them. In this loop, at the very start, it moves the dataset cursor to the next record. Unfortunatly this runs before the first record has had a chance to run.
Open the file:
app/31909/src/Application/DeskPRO/Usersource/Sync/Syncer/LdapSyncer.php
Find the line (for me it is on line 154):
for ($i = 1; $records->valid(); ++$i) {
Directly under you will see the following code block:
try {
$records->next();
} catch (LdapException $e) {
}
We have replaced this with:
try {
if ($i > 1) {
$records->next();
}
} catch (LdapException $e) {
}
Our code prevents the recordset from moving to the next record, unless the first has been processed.