• Login using non existant user will take user to critical error page and admin will receive email.

    Error Details
    =============
    An error of type E_ERROR was caused in line 491 of the file /web/public_html/wp-content/plugins/wpdirauth/wpDirAuth.php. Error message: Uncaught TypeError: ldap_get_dn(): Argument #2 ($entry) must be of type LDAP\ResultEntry, bool given in /web/public_html/wp-content/plugins/wpdirauth/wpDirAuth.php:491
    Stack trace:
    #0 /web/public_html/wp-content/plugins/wpdirauth/wpDirAuth.php(491): ldap_get_dn(Object(LDAP\Connection), false)
    #1 /web/public_html/wp-content/plugins/wpdirauth/wpDirAuth.php(1379): wpDirAuth_auth('nonexistentuser', 'SomePassword...')
    #2 /web/public_html/wp-includes/class-wp-hook.php(310): wpDirAuth_authenticate(NULL, 'nonexistentuser', 'SomePassword...')
    #3 /web/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(NULL, Array)
    #4 /web/public_html/wp-includes/pluggable.php(618): apply_filters('authenticate', NULL, 'nonexistentuser', 'SomePassword...')
    #5 /web/public_html/wp-includes/user.php(106): wp_authenticate('nonexistentuser', 'SomePassword...')
    #6 /web/public_html/wp-login.php(1241): wp_signon(Array, true)
    #7 {main}
      thrown
    

    WordPress version 6.3.1
    Active theme: Newspaper (version 10.4)
    Current plugin: wpDirAuth (version 1.10.7)
    PHP version 8.1.24

    • This topic was modified 1 year, 5 months ago by rwahyudi.
Viewing 1 replies (of 1 total)
  • Plugin Author Paul Gilzow

    (@gilzow)

    oh, boy. this one is going to be fun to debug….

    to get to line 491, you would have had to have a valid return (non boolean false) at line 490 for
    $results = @ldap_search($connection, $baseDn, $filterQuery, $returnKeys)) !== false

    A return of false would indicate a failure from ldap_first_entry and not just an empty return set.

    Is there anything else in your logs that might shed some light on why the call to ldap_first_entry failed?

    Can you try running this script (and adding in the necessary info) https://github.com/gilzow/simple-ldap-test/blob/master/ldap.php on your instance to help debug ?

    • This reply was modified 1 year, 5 months ago by Paul Gilzow. Reason: mentioned wrong ldap method
Viewing 1 replies (of 1 total)
  • The topic ‘Error on PHP8.1 when user does not exist’ is closed to new replies.