#102 Failure to connect to server breaks Login page

v2.8.0
closed-fixed
nobody
None
5
2009-11-05
2009-10-30
Gabor Laszlo
No

since $searchLDAP->server() is NULL in this case, around line 563 of login.php, if($searchResult) is false and the ldap_error($searchLDAP->server()); call dies with 'Warning: ldap_error(): supplied argument is not a valid ldap link resource in /usr/share/ldap-account-manager/templates/login.php', also causing a knock-on warning when the page tries to set the language in the header because the warning has already sent output into the page.

Check assumptions and redo error reporting.

Discussion

  • Roland Gruber
    Roland Gruber
    2009-11-01

    I tried to reproduce the problem by shutting down LDAP and then tried the login. But there was a normal error message from LAM and no PHP error message. How do you reproduce this error?
    Can you recheck the line number? There is no related code around line 563.

     
  • Gabor Laszlo
    Gabor Laszlo
    2009-11-01

    Sorry, I later noticed that it only triggers if LAM Login Method is set to LDAP Search.

     
  • Roland Gruber
    Roland Gruber
    2009-11-01

    I tried it with the LDAP search method but cannot reproduce the PHP error message.
    Can you write me the line number which is printed in the error message?

     
  • Gabor Laszlo
    Gabor Laszlo
    2009-11-02

    The warning says 463, but it's actually 468.

     
  • Roland Gruber
    Roland Gruber
    2009-11-03

     
    Attachments
  • Roland Gruber
    Roland Gruber
    2009-11-03

     
    Attachments
  • Roland Gruber
    Roland Gruber
    2009-11-03

    I think that I found the problem. Please try to replace lib/ldap.inc and templates/login.php with the attached files.
    Please report if this fixes the problem.

     
  • Gabor Laszlo
    Gabor Laszlo
    2009-11-05

    Thanks, that did it.

     
  • Gabor Laszlo
    Gabor Laszlo
    2009-11-05

    • status: open --> closed-fixed