mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
fix for change_delete_user: delete calendar entries without participants (can happen if the deleted user is the only participants, but not the owner)
This commit is contained in:
parent
bc1ed0b65e
commit
76c85cb5db
@ -1074,6 +1074,19 @@ ORDER BY cal_user_type, cal_usre_id
|
||||
'cal_user_type' => $user_type,
|
||||
'cal_user_id' => $user_id,
|
||||
),__LINE__,__FILE__);
|
||||
|
||||
// delete calendar entries without participants (can happen if the deleted user is the only participants, but not the owner)
|
||||
$ids = array();
|
||||
$this->db->select($this->cal_table,"DISTINCT $this->cal_table.cal_id",'cal_user_id IS NULL',__LINE__,__FILE__,
|
||||
False,'',False,0,"LEFT JOIN $this->user_table USING (cal_id)");
|
||||
while(($row = $this->db->row(true)))
|
||||
{
|
||||
$ids[] = $row['cal_id'];
|
||||
}
|
||||
foreach($ids as $cal_id)
|
||||
{
|
||||
$this->delete($cal_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user