While testing the server ldap configuration for userand group binding, it shows "HTTP ERROR 500"

Comments

rivedav created an issue. See original summary.

grahl’s picture

Hi there

This is likely already fixed by one of the pending patches. However, we need more information from you to isolate the issue. Please enable the PHP error log on your side and provide us with the error message causing the 500.

rivedav’s picture

Hi,

I try different ways to enable error display or error logs but I coudn't.
The following link " https://www.drupal.org/node/15804 ": stablish to copy/paste the code in the index.ini file, then replicate the error, then I got the following error displayed "E_ERROR Error in file �ServerTestForm.php� at line 412: Cannot access protected property Drupal\ldap_servers\Entity\Server::$connection"

This is the same error as reported here: LDAP Server: Cannot access protected property

grahl’s picture

Issue tags: -Testing Server
grahl’s picture

Priority: Critical » Major

Thank you for your feedback, that helps.

Apparently, testing of group configurations is not really ported yet. Since I haven't touched groups I'm not able to offer a quickfix. You should be able to run tests (albeit without information on groups) by commenting out or deleting the functional block starting with " if (!$has_errors &&" (should be line 409-573).

rivedav’s picture

grahl, as you said commented line 409 to 573 from the php file "modules\ldap\ldap_servers\src\Form\ServerTestForm.php" solved the problem. Now the test functionality can be perform.

Thank you for the information.

queenvictoria’s picture

Status: Active » Closed (won't fix)
Related issues: +#2730931: No tests are run

Testing isn't implemented at all yet in D8 pending a complete rewrite and possible retirement of the ldap_test module in favour of integrated D8 style tests. I'm going to close this issue pending @larowlan and @grahl's efforts in this area. See work in the related ticket

Forget that. This ticket isn't related to testing as such just testing the server connection using the server test button.

queenvictoria’s picture

Status: Closed (won't fix) » Active

  • grahl committed f8158e0 on 8.x-3.x
    Issue #2730723: Temporary workaround...
grahl’s picture

As can be seen above I deactivated the function similar to my previous post since the current code cannot work.

I figured something along the lines of the following should work, but I'm not familiar enough with the relevant query structure, to find the problem.

- $result = @ldap_read($ldap_server->connection, $group_dn, 'objectClass=*');
+ $result = $ldap_server->search($group_dn, 'objectClass=*');

  • grahl committed a26be3b on 8.x-3.x
    Issue #2730723 by grahl: Testing an ldap user by using a service account...
grahl’s picture

Status: Active » Fixed

I'm tentatively marking this fixed because I've resolved all obvious issues with the form. However I've left a fixme comment since I don't have the setup to test group derivement fully. I get a value back from the Hogwarts data as "people" so at the very least the form works well, I'm not 100% sure about the query itself since that's undocumented.

I took the liberty of rearranging the form a bit and truncating / marking binary values to make the form not overrun the page.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.