Ignore:
Timestamp:
Apr 15, 2010 2:33:30 AM (3 years ago)
Author:
thomasb
Message:

Always set changed date when marking a DB record as deleted + provide a cleanup script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_contacts.php

    r3485 r3489  
    404404      $ids = join(',', $ids); 
    405405 
    406     // delete all group members linked with these contacts 
    407     if ($this->groups) { 
    408       $this->db->query( 
    409         "DELETE FROM ".get_table_name('contactgroupmembers')." 
    410          WHERE  contact_id IN (".$ids.")"); 
    411     } 
    412  
     406    // flag record as deleted 
    413407    $this->db->query( 
    414408      "UPDATE ".$this->db_name." 
    415        SET    del=1 
     409       SET    del=1, changed=".$this->db->now()." 
    416410       WHERE  user_id=? 
    417411       AND    contact_id IN (".$ids.")", 
     
    457451 
    458452  /** 
    459    * Delete the given group and all linked group members 
     453   * Delete the given group (and all linked group members) 
    460454   * 
    461455   * @param string Group identifier 
     
    464458  function delete_group($gid) 
    465459  { 
    466     $sql_result = $this->db->query( 
    467       "DELETE FROM ".get_table_name('contactgroupmembers')." 
    468        WHERE  contactgroup_id=?", 
    469       $gid); 
    470      
     460    // flag group record as deleted 
    471461    $sql_result = $this->db->query( 
    472462      "UPDATE ".get_table_name('contactgroups')." 
Note: See TracChangeset for help on using the changeset viewer.