formcreator icon indicating copy to clipboard operation
formcreator copied to clipboard

problems with ldap field

Open CLcdiazp opened this issue 2 years ago • 18 comments

update the version thinking that the error of not displaying the users in ldap is fixed but the problem persists

[evidence 1] image

[evidence 2] image

CLcdiazp avatar Aug 30 '23 15:08 CLcdiazp

Hi,

Which error are you talking about ? Is it an other issue you opened before ?

btry avatar Aug 30 '23 15:08 btry

Hola

¿De qué error estás hablando? ¿Es otro problema que abriste antes?

Hi,

Which error are you talking about ? Is it an other issue you opened before ?

Hi, I didn't upload it here before, but I asked the glpi group for support on Spanish telegram with no response I thought that with this update it would be solved

CLcdiazp avatar Aug 30 '23 16:08 CLcdiazp

Solved bugs are inventoried in the changelog. Don't hesitate to have a look in this file. It is also available in the release notes.

Which version of PHP are you using ?

btry avatar Aug 30 '23 16:08 btry

Solved bugs are inventoried in the changelog. Don't hesitate to have a look in this file. It is also available in the release notes.

PHP version (8.2.4) is supported.PHP version (8.2.4) is supported.

CLcdiazp avatar Aug 30 '23 16:08 CLcdiazp

In your 1st screenshot, I translated the message in the drop-down. This is not an error.

Can you check in php-error.log if you have errors ?

Also, your LDAP filter is empty. This is probably a source of problems. What is the type of ldap ? Active directory, slapd ?

btry avatar Aug 30 '23 16:08 btry

In your 1st screenshot, I translated the message in the drop-down. This is not an error.

Can you check in php-error.log if you have errors ?

I really don't know how to define it. Since with or without a filter the same thing happens. I configure the parameter and the box where one performs the search for the user through the active directory is temporarily displayed, its display is less than 2 seconds and it disappears

Evidencia 3

In this example, I had to load the display of the form to be able to briefly display the box and be able to search for the administrator

CLcdiazp avatar Aug 30 '23 16:08 CLcdiazp

in the ldapselectfield fix: record the LDAP error instead of showing it to the user (e170dc6f) I have to remove line 142 that is in red and negative and add the line in red

Evidencia 4

CLcdiazp avatar Aug 30 '23 16:08 CLcdiazp

So you reverted the patch ?

I'm not in from of the code now (holidays), but if I remember well this code may be used when lazy loading the items of the drop-down. The call to message after redirect is not the gold option here. Anyway, your finding means that your error comes from a too big list of items ? You probably exceeded a limit of the ldap server.

btry avatar Aug 30 '23 17:08 btry

So you reverted the patch ?

I'm not in from of the code now (holidays), but if I remember well this code may be used when lazy loading the items of the drop-down. The call to message after redirect is not the gold option here. Anyway, your finding means that your error comes from a too big list of items ? You probably exceeded a limit of the ldap server.

Thank you very much for considering this publication in your holidays. The code is default. I don't know if the php code has any element limit, but if I only have 408 users, this error only appears in the form since glpi works without problems in ldap

CLcdiazp avatar Aug 30 '23 17:08 CLcdiazp

Actually, I don't understand how to apply the fix (e170dc6f)

CLcdiazp avatar Aug 30 '23 17:08 CLcdiazp

Hi

To apply a patch you must download it (append .diff to the URL in the browser's address bar and you'll get a file to download).

Use the patch tool (available in most Linux distros) to apply the patch:

  • locate in Formcreator's directory
  • patch -p1 --dry-run < /path/to/file.diff
  • if no error, repeat the command without --dry-run
  • if error, then report it here.

btry avatar Sep 03 '23 10:09 btry

Let's see if I understand, I'll do it and tell you

CLcdiazp avatar Sep 13 '23 21:09 CLcdiazp

.diff

I have GLPI installed on Windows Server 2022 I tried to do what you asked but it didn't work :,)

this is the code https://ibb.co/RcmsL2b

CLcdiazp avatar Sep 13 '23 21:09 CLcdiazp

Hi

Download the patch with this link https://github.com/pluginsGLPI/formcreator/commit/e170dc6f9149f2bb1e57968e219e80bb71db98ba.diff

btry avatar Sep 14 '23 08:09 btry

You may use the windows version of the patch tool: https://gnuwin32.sourceforge.net/packages/patch.htm

btry avatar Sep 14 '23 08:09 btry

Hi

Download the patch with this link https://github.com/pluginsGLPI/formcreator/commit/e170dc6f9149f2bb1e57968e219e80bb71db98ba.diff

I already downloaded it

CLcdiazp avatar Sep 15 '23 16:09 CLcdiazp

hi, check the patch and that command line is already modified in the ldapdropdown.class.php file would be this line

138 // openldap return 4 for Size limit exceeded 139 $limitexceeded = in_array(ldap_errno($ds), [4, 11]); 140 141 if ($limitexceeded) { 142 Toolbox::logError("LDAP size limit exceeded"); 143 } 144 145 unset($entries['count']);

the problem still exists

CLcdiazp avatar Sep 15 '23 16:09 CLcdiazp

I performed a test leaving the GLPI in debugging mode and the user search box appears, but when debugging is deactivated the problem persists

CLcdiazp avatar Sep 15 '23 16:09 CLcdiazp