mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 00:09:13 +01:00
extend ctag to lists
This commit is contained in:
parent
5c020ac87d
commit
6f1c2eacac
@ -623,7 +623,7 @@ class addressbook_groupdav extends groupdav_handler
|
||||
// not showing addressbook of a single user?
|
||||
if (!$user || $path == '/addressbook/') $user = null;
|
||||
|
||||
return $this->bo->get_ctag($user);
|
||||
return max($this->bo->get_ctag($user),$this->bo->lists_ctag($user));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1057,4 +1057,17 @@ class addressbook_so
|
||||
|
||||
return method_exists($backend,'read_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ctag (max list_modified as timestamp) for lists
|
||||
*
|
||||
* @param int|array $owner=null null for all lists user has access too
|
||||
* @return int
|
||||
*/
|
||||
function lists_ctag($owner=null)
|
||||
{
|
||||
if (!method_exists($this->somain,'read_list')) return 0;
|
||||
|
||||
return $this->somain->lists_ctag($owner);
|
||||
}
|
||||
}
|
||||
|
@ -646,6 +646,24 @@ class addressbook_sql extends so_sql_cf
|
||||
return $this->db->affected_rows();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ctag (max list_modified as timestamp) for lists
|
||||
*
|
||||
* @param int|array $owner=null null for all lists user has access too
|
||||
* @return int
|
||||
*/
|
||||
function lists_ctag($owner=null)
|
||||
{
|
||||
if (is_null($owner)) $owner = array_keys($this->grants);
|
||||
|
||||
if (!($modified = $this->db->select($this->lists_table,'MAX(list_modified)',array('list_owner'=>$owner),
|
||||
__LINE__,__FILE__)->fetchColumn()))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return $this->db->from_timestamp($modified);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a contact, reimplemented to use the uid, if a non-numeric key is given
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user