Fix bug in handling bound resources with DAVResource changes.

Signed-off-by: Andrew McMillan <andrew@morphoss.com>
This commit is contained in:
Andrew McMillan 2011-01-04 18:46:51 +13:00
parent 51576df490
commit 595e724426
2 changed files with 6 additions and 3 deletions

View File

@ -115,7 +115,7 @@ function get_collection_contents( $depth, $collection, $parent_path = null ) {
$responses = array();
if ( ! $collection->IsCalendar() && ! $collection->IsAddressbook() ) {
/**
* Calendar/Addressbook collections may not contain collections, so we won't look
* Calendar/Addressbook collections may not contain collections, so we are only looking in the other ones
*/
$params = array( ':session_principal' => $session->principal_id, ':scan_depth' => $c->permission_scan_depth );
if ( $bound_from == '/' ) {
@ -204,8 +204,11 @@ function get_collection_contents( $depth, $collection, $parent_path = null ) {
$qry = new AwlQuery( $sql, array( ':collection_dav_name' => $bound_from) );
if( $qry->Exec('PROPFIND',__LINE__,__FILE__) && $qry->rows() > 0 ) {
while( $item = $qry->Fetch() ) {
if ( $bound_from != $bound_to ) {
$item->bound_from = $item->dav_name;
$item->dav_name = str_replace($bound_from,$bound_to,$item->dav_name);
}
$resource = new DAVResource($item);
$resource->set_bind_location( str_replace($bound_from,$bound_to,$item->dav_name));
$responses[] = $resource->RenderAsXML($property_list, $reply, $parent_path );
}
}

View File

@ -6,7 +6,7 @@
<prop>
<displayname>User 2's Calendar, as uploaded by Admin</displayname>
<owner>
<href>/user4/</href>
<href>/caldav.php/user2/</href>
</owner>
<current-user-privilege-set>
<privilege>