mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-04 10:11:26 +01:00
* CalDAV/CardDAV: only show own user and memberships on automatic index page (or PROPFIND) for privacy and security reasons
This commit is contained in:
parent
66a4baf75f
commit
a7f5d333d0
@ -447,8 +447,11 @@ class CalDAV extends HTTP_WebDAV_Server
|
||||
$files['files'][] = $this->add_collection('/principals/', array(
|
||||
'displayname' => lang('Accounts'),
|
||||
));
|
||||
// users home
|
||||
$this->add_home($files, $path.$GLOBALS['egw_info']['user']['account_lid'].'/', $GLOBALS['egw_info']['user']['account_id'], $options['depth'] == 'infinity' ? 'infinity' : $options['depth']-1);
|
||||
// home of memberships
|
||||
foreach($this->accounts->search([
|
||||
'type' => 'both',
|
||||
'type' => 'owngroups',
|
||||
'order' =>'account_lid',
|
||||
'start' => $_GET['start'] ?? 0,
|
||||
'offset' => $nresults,
|
||||
|
@ -790,21 +790,10 @@ class Principals extends Handler
|
||||
|
||||
if ($options['depth'])
|
||||
{
|
||||
if ($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] == 'none' &&
|
||||
!isset($GLOBALS['egw_info']['user']['apps']['admin']))
|
||||
// only display own user by default
|
||||
if (($account = $this->accounts->read($GLOBALS['egw_info']['user']['account_id'])))
|
||||
{
|
||||
if (($account = $this->accounts->read($GLOBALS['egw_info']['user']['account_id'])))
|
||||
{
|
||||
$files[] = $this->add_account($account);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// add all users (account_selection == groupmembers is handled by accounts->search())
|
||||
foreach($this->accounts->search(array('type' => 'accounts','order' => 'account_lid')) as $account)
|
||||
{
|
||||
$files[] = $this->add_account($account);
|
||||
}
|
||||
$files[] = $this->add_account($account);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -862,12 +851,8 @@ class Principals extends Handler
|
||||
|
||||
if ($options['depth'])
|
||||
{
|
||||
// only show own groups, if account-selection is groupmembers or none
|
||||
$type = in_array($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'], array('groupmembers','none')) ?
|
||||
'owngroups' : 'groups';
|
||||
|
||||
// add all groups or only membergroups
|
||||
foreach($this->accounts->search(array('type' => $type,'order' => 'account_lid')) as $account)
|
||||
// only show own groups
|
||||
foreach($this->accounts->search(array('type' => 'owngroups','order' => 'account_lid')) as $account)
|
||||
{
|
||||
$files[] = $this->add_group($account);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user