summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_contacts.php
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-15 06:33:30 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-04-15 06:33:30 +0000
commitbbe3c2010df9041645a60c76cc3d3694a3aa05eb (patch)
tree50b19693ce589b993b6281d391483c28c3731361 /roundcubemail/program/include/rcube_contacts.php
parent39daa0f89694f758f0544fce7ec48ed3230eea2c (diff)
Always set changed date when marking a DB record as deleted + provide a cleanup script
git-svn-id: https://svn.roundcube.net/trunk@3489 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_contacts.php')
-rw-r--r--roundcubemail/program/include/rcube_contacts.php18
1 files changed, 4 insertions, 14 deletions
diff --git a/roundcubemail/program/include/rcube_contacts.php b/roundcubemail/program/include/rcube_contacts.php
index dd37972c2..b8307d49a 100644
--- a/roundcubemail/program/include/rcube_contacts.php
+++ b/roundcubemail/program/include/rcube_contacts.php
@@ -403,16 +403,10 @@ 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.")");
- }
-
+ // flag record as deleted
$this->db->query(
"UPDATE ".$this->db_name."
- SET del=1
+ SET del=1, changed=".$this->db->now()."
WHERE user_id=?
AND contact_id IN (".$ids.")",
$this->user_id);
@@ -456,18 +450,14 @@ class rcube_contacts extends rcube_addressbook
}
/**
- * Delete the given group and all linked group members
+ * Delete the given group (and all linked group members)
*
* @param string Group identifier
* @return boolean True on success, false if no data was changed
*/
function delete_group($gid)
{
- $sql_result = $this->db->query(
- "DELETE FROM ".get_table_name('contactgroupmembers')."
- WHERE contactgroup_id=?",
- $gid);
-
+ // flag group record as deleted
$sql_result = $this->db->query(
"UPDATE ".get_table_name('contactgroups')."
SET del=1, changed=".$this->db->now()."