#1488420 closed Bugs (fixed)

Contact photo issues with LDAP addressbook

Reported by: alec Owned by:
Priority: 5 Milestone: 0.8-stable
Component: Addressbook Version: git-master
Severity: normal Keywords:
Cc:

Description (last modified by alec)

Configuration:

'photo' => 'jpegPhoto'

I can add or update photo, but:

  1. It's not possible to remove photo
  2. It's not possible to update contact information when contact has a photo defined.

The error message is: "ldap_mod_del(): Modify: Inappropriate matching in..."

Change History (4)

comment:1 Changed 14 months ago by alec

  • Description modified (diff)
  1. fixed in [21a0d919].

comment:2 Changed 13 months ago by qustodium

Editing contacts with a jpegPhoto now works: thank you very much!

However, trying to delete the jpegPhoto still results in an error:

[12-Apr-2012 13:19:21 +0200]: S: OK
[12-Apr-2012 13:19:21 +0200]: C: Delete [dn: cn=Contact,cn=user@domain.tld,ou=private,ou=rcabook,dc=domain,dc=tld]: Array(
    [jpegphoto] => Array        (
     ..]
)
)
[12-Apr-2012 13:19:21 +0200]: S: Inappropriate matching 

comment:3 Changed 11 months ago by jogaand

The error: "Inappropriate Matching" will be displayed if the attribute you are trying to delete(jpegPhoto) has no equality rule in the schema(inetOrgPerson). (http://www.php.net/manual/ru/function.ldap-mod-del.php#9706)

Modify the schema is not a good idea and i decided this way:

Before

// Field supplied is empty, verify that it is not required.
if (!in_array($fld, $this->prop['required_fields'])) {
        // It is not, safe to clear.
        $deletedata[$fld] = $old_data[$fld];
}

After

// Field supplied is empty, verify that it is not required.
if (!in_array($fld, $this->prop['required_fields'])) {
        // It is not, safe to clear.
        if ($fld == $this->fieldmap['photo']){
                $deletedata[$fld] = array();
        } else {
                $deletedata[$fld] = $old_data[$fld];
        }
}

file: program/include/rcube_ldap.php
line: 1195

Now, when you are trying to delete will be removed all attributes with the name "jpegPhoto" but I don't know any other way

P.S. It's not too bad because only one attribute can be saved

comment:4 Changed 11 months ago by alec

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed

It looks that we can use array() for all other attributes. Fixed in [afaccf14].

Note: See TracTickets for help on using tickets.