diff --git a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php index dbbf75d448..4b54fc000d 100644 --- a/addressbook/inc/class.addressbook_import_contacts_csv.inc.php +++ b/addressbook/inc/class.addressbook_import_contacts_csv.inc.php @@ -169,15 +169,20 @@ class addressbook_import_contacts_csv implements importexport_iface_import_plugi switch ( $condition['type'] ) { // exists case 'exists' : - $contacts = $this->bocontacts->search( - //array( $condition['string'] => $record[$condition['string']],), - '', - $_definition->plugin_options['update_cats'] == 'add' ? false : true, - '', '', '', false, 'AND', false, - array( $condition['string'] => $record[$condition['string']],) - ); - - if ( is_array( $contacts ) && count( array_keys( $contacts ) >= 1 ) ) { + if($record[$condition['string']]) { + $searchcondition = array( $condition['string'] => $record[$condition['string']]); + // if we use account_id for the condition, we need to set the owner for filtering, as this + // enables addressbook_so to decide what backend is to be used + if ($condition['string']=='account_id') $searchcondition['owner']=0; + $contacts = $this->bocontacts->search( + //array( $condition['string'] => $record[$condition['string']],), + '', + $_definition->plugin_options['update_cats'] == 'add' ? false : true, + '', '', '', false, 'AND', false, + $searchcondition + ); + } + if ( is_array( $contacts ) && count( array_keys( $contacts ) ) >= 1 ) { // apply action to all contacts matching this exists condition $action = $condition['true']; foreach ( (array)$contacts as $contact ) { diff --git a/addressbook/inc/class.addressbook_so.inc.php b/addressbook/inc/class.addressbook_so.inc.php index d6980441a6..4cc650f24c 100755 --- a/addressbook/inc/class.addressbook_so.inc.php +++ b/addressbook/inc/class.addressbook_so.inc.php @@ -122,7 +122,7 @@ class addressbook_so var $ldap_search_attributes = array( 'n_family','n_middle','n_given','org_name','org_unit', 'adr_one_location','adr_two_location','note', - 'email','mozillasecondemail', + 'email','mozillasecondemail','uidnumber', ); /** * In SQL we can search all columns, though a view make on real sense