diff --git a/phpgwapi/inc/class.accounts_contacts.inc.php b/phpgwapi/inc/class.accounts_contacts.inc.php index 78fa8f7b5a..2c919539b3 100644 --- a/phpgwapi/inc/class.accounts_contacts.inc.php +++ b/phpgwapi/inc/class.accounts_contacts.inc.php @@ -99,14 +99,7 @@ global $phpgw, $phpgw_info; $account_id = get_account_id($accountid); - $account_lid = $this->id2name($account_id); - $ds = $phpgw->common->ldapConnect(); - $sri = ldap_search($ds, $phpgw_info['server']['ldap_context'], 'uid='.$account_lid); - $allValues = ldap_get_entries($ds, $sri); - - if ($allValues[0]['dn']) { - $del = ldap_delete($ds, $allValues[0]['dn']); - } + $this->contacts->delete($account_id); // Do this last since we are depending upon this record to get the account_lid above $this->db->query('DELETE FROM phpgw_accounts WHERE account_id='.$account_id);