Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.5.2
    • Fix Version/s: 1.8.6, 1.9.2
    • Component/s: Authentication
    • Labels:
      None
    • Environment:
      Windows 2000
    • Affected Branches:
      MOODLE_15_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      27552

      Description

      I have LDAP Auth against Win2k AD on a Moodle 1.5.2 +

      In Phone1, Phone2 and Address fields, I have the Update External option set to On Update.

      When updating user profiles, and if any of these fields is empty, gives me an error:

      Warning: ldap_modify(): Modify: Invalid syntax in /var/www/moodle/auth/ldap/lib.php on line 850.

      And doesn't empty the fields in Win2k AD.

        Activity

        Hide
        Iñaki Arenaza added a comment -

        According to http://es2.php.net/manual/en/function.ldap-modify.php#43216 we need to specify an array() value to delete an attribute's value, instead of an empty string.

        I have tested this with Moodle 1.9 running on W2003/II6 with PHP 5.2.x and it does in fact work as expected. I have mapped Phone1 to 'homePhone' and Address to 'streetAddress' and I can change the values without problem, and can 'delete' the values if I specify them as empty arrays, instead of empty strings.

        So we just need to add one line to handle all of this:

        empty($nuvalue) ? $nuvalue = array() : $nuvalue;

        and voila!

        In going to fix the bug in 1.8, 1.9 and HEAD.

        Saludos. Iñaki.

        Show
        Iñaki Arenaza added a comment - According to http://es2.php.net/manual/en/function.ldap-modify.php#43216 we need to specify an array() value to delete an attribute's value, instead of an empty string. I have tested this with Moodle 1.9 running on W2003/II6 with PHP 5.2.x and it does in fact work as expected. I have mapped Phone1 to 'homePhone' and Address to 'streetAddress' and I can change the values without problem, and can 'delete' the values if I specify them as empty arrays, instead of empty strings. So we just need to add one line to handle all of this: empty($nuvalue) ? $nuvalue = array() : $nuvalue; and voila! In going to fix the bug in 1.8, 1.9 and HEAD. Saludos. Iñaki.
        Hide
        Iñaki Arenaza added a comment -

        Patches commited to CVS for 1.8, 1.9 and HEAD.

        Thanks for the report!

        Saludos. Iñaki.

        Show
        Iñaki Arenaza added a comment - Patches commited to CVS for 1.8, 1.9 and HEAD. Thanks for the report! Saludos. Iñaki.
        Hide
        Petr Škoda added a comment -

        thanks

        Show
        Petr Škoda added a comment - thanks

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: