pluginsGLPI / formcreator

GLPI Plugin Formcreator (DOWNLOAD : https://github.com/pluginsGLPI/formcreator/releases)
http://www.teclib-edition.com
GNU General Public License v3.0
174 stars 125 forks source link

problems with ldap field #3362

Open CLcdiazp opened 1 year ago

CLcdiazp commented 1 year ago

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

btry commented 1 year ago

Hi,

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

CLcdiazp commented 1 year ago

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

btry commented 1 year ago

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 ?

CLcdiazp commented 1 year ago

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.

btry commented 1 year ago

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 ?

CLcdiazp commented 1 year ago

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 commented 1 year ago

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

btry commented 1 year ago

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.

CLcdiazp commented 1 year ago

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 commented 1 year ago

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

btry commented 1 year ago

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:

CLcdiazp commented 1 year ago

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

CLcdiazp commented 1 year ago

.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

btry commented 1 year ago

Hi

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

btry commented 1 year ago

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

CLcdiazp commented 1 year ago

Hi

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

I already downloaded it

CLcdiazp commented 1 year ago

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 commented 1 year ago

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