• mikec55555

    (@mikec55555)


    Hello,

    I installed a fresh copy of this plugin wita week ago on a WordPress 4.x site and it worked fine. I tried again today with a fresh copy of the plugin and it produced a 500 error.

    Am I using the plugin wrong?

    Here are the errors in Apache’s log:

    [Wed Apr 03 16:07:57.978727 2019] [:error] [pid 32220] [client 108.162.53.11:17150] PHP Fatal error: Call to undefined function ldap_escape() in /var/www/vhosts/teststaging-wordpress.trdev.site/web/content/wp-content/plugins/authldap/authLdap.php on line 517, referer: https://teststaging-wordpress.our.site/wp-login.php
    [Wed Apr 03 16:08:49.378441 2019] [:error] [pid 32220] [client 108.162.53.11:34366] PHP Fatal error: Call to undefined function ldap_escape() in /var/www/vhosts/teststaging-wordpress.trdev.site/web/content/wp-content/plugins/authldap/authLdap.php on line 517, referer: https://teststaging-wordpress.our.site/wp-login.php?loggedout=true

    (Domain name of referrer changed : ) )

    So, I compared the two different plugin copies and found a few changes from last week – newer is on the right:

    diff -r authldap /var/www/vhosts/teststaging-wordpress.trdev.site/web/authldap
    diff -r authldap/authLdap.php /var/www/vhosts/teststaging-wordpress.trdev.site/web/authldap/authLdap.php
    6c6
    < Version: 2.1.0

    > Version: 2.1.1
    515c515,519
    < $authLDAPGroupFilter = str_replace(‘%dn%’, $dn, $authLDAPGroupFilter);

    > $authLDAPGroupFilter = str_replace(
    > ‘%dn%’,
    > ldap_escape($dn, ”, LDAP_ESCAPE_FILTER),
    > $authLDAPGroupFilter
    > );
    518c522,526
    < $groups = authLdap_get_server()->search(sprintf($authLDAPGroupFilter, $username), array($authLDAPGroupAttr), $authLDAPGroupBase);

    > $groups = authLdap_get_server()->search(
    > sprintf($authLDAPGroupFilter, ldap_escape($username, ”, LDAP_ESCAPE_FILTER)),
    > array($authLDAPGroupAttr),
    > $authLDAPGroupBase
    > );
    diff -r authldap/readme.txt /var/www/vhosts/teststaging-wordpress.trdev.site/web/authldap/readme.txt
    42a43,45
    > = 2.1.1 =
    > * Add escaping filter-values. That should help filtering for groups where the DN might contain braces or spaces
    >

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author heiglandreas

    (@heiglandreas)

    You are most probably using an outdated PHP-version as the ldap_escape function is only available from PHP5.6 on. That’s why the plugin version 2.1.1 requires at least PHP5.6 as noted in the readme.txt – Though I’ve just noticed that the plugin page still states PHP5.4 as the min version.

    Thanks for bringing that to my aftention. I see to fix that ASAP.

    So for you the tso options are either to upgrade your PHP to a supported version (7.1 or higher – highly recommended!) or use an older version of the plugin.

    Thread Starter mikec55555

    (@mikec55555)

    Thank you! Do you have a version of the plugin that supports PHP 5.3? We have quite a few older sites we need to retire soon.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin 500 Error’ is closed to new replies.