mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
* CardDAV/Addressbook/ActiveDirectory: fixes SQL error when clients tries to propfind groups/distribution lists on accounts-addressbook, also return "403 Forbidden" when he tries to create one, as they are not (yet) supported on accounts, if not stored in SQL
This commit is contained in:
parent
c61ccc9372
commit
f4597f6314
@ -977,9 +977,10 @@ class addressbook_so
|
||||
*/
|
||||
function read_lists($keys,$member_attr=null,$limit_in_ab=false)
|
||||
{
|
||||
if (!method_exists($this->somain,'get_lists')) return false;
|
||||
$backend = (string)$limit_in_ab === '0' && $this->so_accounts ? $this->so_accounts : $this->somain;
|
||||
if (!method_exists($backend, 'get_lists')) return false;
|
||||
|
||||
return $this->somain->get_lists($keys,null,$member_attr,$limit_in_ab);
|
||||
return $backend->get_lists($keys,null,$member_attr,$limit_in_ab);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -993,9 +994,10 @@ class addressbook_so
|
||||
*/
|
||||
function add_list($keys,$owner,$contacts=array(),array &$data=array())
|
||||
{
|
||||
if (!method_exists($this->somain,'add_list')) return false;
|
||||
$backend = (string)$owner === '0' && $this->so_accounts ? $this->so_accounts : $this->somain;
|
||||
if (!method_exists($backend, 'add_list')) return false;
|
||||
|
||||
return $this->somain->add_list($keys,$owner,$contacts,$data);
|
||||
return $backend->add_list($keys,$owner,$contacts,$data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -468,7 +468,7 @@ class addressbook_sql extends so_sql_cf
|
||||
*/
|
||||
function get_lists($uids,$uid_column='list_owner',$member_attr=null,$limit_in_ab=false)
|
||||
{
|
||||
if (is_array($uids) && isset($uids['list_carddav_name']))
|
||||
if (is_array($uids) && (array_key_exists('list_carddav_name', $uids) || array_key_exists('list_id', $uids)))
|
||||
{
|
||||
$ids = array();
|
||||
foreach((array)$uids['list_carddav_name'] as $carddav_name)
|
||||
@ -479,6 +479,11 @@ class addressbook_sql extends so_sql_cf
|
||||
}
|
||||
}
|
||||
unset($uids['list_carddav_name']);
|
||||
foreach((array)$uids['list_id'] as $id)
|
||||
{
|
||||
if (is_numeric($id) && $id > 0) $ids[] = $id;
|
||||
}
|
||||
unset($uids['list_id']);
|
||||
if (!$ids) return array();
|
||||
$uids[] = $this->db->expression($this->lists_table, $this->lists_table.'.',array('list_id' => $ids));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user