mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
"- correct handling of depth: 0 in /
- initialise $files['files'] = array() to quiten some warning if propfind returns nothing"
This commit is contained in:
parent
b69b8085e6
commit
dfc7176959
@ -133,7 +133,7 @@ class groupdav extends HTTP_WebDAV_Server
|
|||||||
}
|
}
|
||||||
if ($this->debug > 1) error_log(__CLASS__."::$method: user=$user, app='$app', id=$id");
|
if ($this->debug > 1) error_log(__CLASS__."::$method: user=$user, app='$app', id=$id");
|
||||||
|
|
||||||
$files = array();
|
$files = array('files' => array());
|
||||||
|
|
||||||
if (!$app) // root folder containing apps
|
if (!$app) // root folder containing apps
|
||||||
{
|
{
|
||||||
@ -144,39 +144,42 @@ class groupdav extends HTTP_WebDAV_Server
|
|||||||
self::mkprop('displayname','eGroupWare'),
|
self::mkprop('displayname','eGroupWare'),
|
||||||
self::mkprop('resourcetype','collection'),
|
self::mkprop('resourcetype','collection'),
|
||||||
// adding the calendar extra property (calendar-home-set, etc.) here, allows apple iCal to "autodetect" the URL
|
// adding the calendar extra property (calendar-home-set, etc.) here, allows apple iCal to "autodetect" the URL
|
||||||
self::mkprop(groupdav::CALDAV,'calendar-home-set',$_SERVER['SCRIPT_NAME'].'/calendar/'),
|
self::mkprop(groupdav::CALDAV,'calendar-home-set',$this->base_uri.'/calendar/'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// principals collection
|
if ($options['depth'])
|
||||||
$files['files'][] = array(
|
|
||||||
'path' => '/principals/',
|
|
||||||
'props' => array(
|
|
||||||
self::mkprop('displayname',lang('Accounts')),
|
|
||||||
self::mkprop('resourcetype','collection'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
// groups collection
|
|
||||||
$files['files'][] = array(
|
|
||||||
'path' => '/groups/',
|
|
||||||
'props' => array(
|
|
||||||
self::mkprop('displayname',lang('Groups')),
|
|
||||||
self::mkprop('resourcetype','collection'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($this->root as $app => $data)
|
|
||||||
{
|
{
|
||||||
if (!$GLOBALS['egw_info']['user']['apps'][$app]) continue; // no rights for the given app
|
// principals collection
|
||||||
|
|
||||||
$extra_props = 'groupdav_'.$app.'::extra_properties';
|
|
||||||
|
|
||||||
$files['files'][] = array(
|
$files['files'][] = array(
|
||||||
'path' => '/'.$app.'/',
|
'path' => '/principals/',
|
||||||
'props' => call_user_func($app.'_groupdav::extra_properties',array(
|
'props' => array(
|
||||||
self::mkprop('displayname',$this->translation->convert(lang($app),$this->egw_charset,'utf-8')),
|
self::mkprop('displayname',lang('Accounts')),
|
||||||
self::mkprop('resourcetype',$this->_resourcetype($app)),
|
self::mkprop('resourcetype','collection'),
|
||||||
)),
|
),
|
||||||
);
|
);
|
||||||
|
// groups collection
|
||||||
|
$files['files'][] = array(
|
||||||
|
'path' => '/groups/',
|
||||||
|
'props' => array(
|
||||||
|
self::mkprop('displayname',lang('Groups')),
|
||||||
|
self::mkprop('resourcetype','collection'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($this->root as $app => $data)
|
||||||
|
{
|
||||||
|
if (!$GLOBALS['egw_info']['user']['apps'][$app]) continue; // no rights for the given app
|
||||||
|
|
||||||
|
$extra_props = 'groupdav_'.$app.'::extra_properties';
|
||||||
|
|
||||||
|
$files['files'][] = array(
|
||||||
|
'path' => '/'.$app.'/',
|
||||||
|
'props' => call_user_func($app.'_groupdav::extra_properties',array(
|
||||||
|
self::mkprop('displayname',$this->translation->convert(lang($app),$this->egw_charset,'utf-8')),
|
||||||
|
self::mkprop('resourcetype',$this->_resourcetype($app)),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user