From e0690d23426a482cad0557aa08d754e7c83eee11 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 20 Oct 2011 20:00:13 +0000 Subject: [PATCH] type attribute for principal-property-search report limiting search on a certain type/tree --- .../inc/class.groupdav_principals.inc.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/phpgwapi/inc/class.groupdav_principals.inc.php b/phpgwapi/inc/class.groupdav_principals.inc.php index eff9670bae..9daba79dfa 100644 --- a/phpgwapi/inc/class.groupdav_principals.inc.php +++ b/phpgwapi/inc/class.groupdav_principals.inc.php @@ -309,6 +309,25 @@ class groupdav_principals extends groupdav_handler $path = '/principals/users/'.$GLOBALS['egw_info']['user']['account_lid'].'/'; } } + // check type attribute to limit search on a certain tree + if (isset($options['root']['attrs']['type'])) + { + switch($options['root']['attrs']['type']) + { + case 'INDIVIDUAL': + $path = '/principals/users/'; + break; + case 'GROUP': + $path = '/principals/groups/'; + break; + case 'ROOM': + $path = '/principals/locations/'; + break; + case 'RESOURCE': + $path = '/principals/resources/'; + break; + } + } // run "regular" propfind $options['other'] = array(); $options['root']['name'] = 'propfind';