From bb6294a26e9ce1dca5e0b8f69a1144ea149e05fe Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 31 Mar 2010 15:45:02 +0000 Subject: Also remove contactgroupmembers when deleting a contact --- program/include/rcube_contacts.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'program/include') diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php index 0946b05f2..2964cde49 100644 --- a/program/include/rcube_contacts.php +++ b/program/include/rcube_contacts.php @@ -399,6 +399,13 @@ class rcube_contacts extends rcube_addressbook if (is_array($ids)) $ids = join(',', $ids); + // delete all group members linked with these contacts + if ($this->groups) { + $this->db->query( + "DELETE FROM ".get_table_name('contactgroupmembers')." + WHERE contact_id IN (".$ids.")"); + } + $this->db->query( "UPDATE ".$this->db_name." SET del=1 -- cgit v1.2.3