View Issue Details

IDProjectCategoryView StatusLast Update
0005588SOGoBackend Calendarpublic2022-08-25 08:57
Reportereugenesu Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version5.7.0 
Summary0005588: Displayname of address books and calendars created for users under admin account are incorrect
Description

There is wrong behaviour in CalDAV engine, as I think: Sogo processes displayname of address books and calendars with CalDAV incorrect.

I try to create calendar collections for users while logged in under admin user account.
If I create the calendar under admin user account then regular user will see GUID instead of the name.

As I understand, when MKCOL request is received, it creates a record in sogo_folder_info with c_folder_name equals to the last part of the path specified in the request by default. If I try to set display name by adding D:displayname prop to the MKCOL request, or by making second PROPPATCH request, it does not set/update folder name globally, but sets it for current user only in sogo_user_profile -> c_settings -> FolderDisplayNames.

Here are the requests I make:

MKCOL https://.../SOGo/dav/.../Contacts/4eaa265a-0e9c-40e5-932e-35728f2b70b0/ HTTP/1.1
<?xml version='1.0'?>
<D:mkcol xmlns:D="DAV:"  xmlns:A="urn:ietf:params:xml:ns:carddav">
 <D:set>
<D:prop>
 <D:resourcetype>
<D:collection/>
<A:addressbook/>
 </D:resourcetype>
 <D:displayname>Contacts1</D:displayname>
</D:prop>
 </D:set>
</D:mkcol>
PROPPATCH https://.../SOGo/dav/.../Contacts/4eaa265a-0e9c-40e5-932e-35728f2b70b0/ HTTP/1.1
<?xml version='1.0'?>
  <D:propertyupdate xmlns:D="DAV:">
<D:set>
 <D:prop>
 <D:displayname>Contacts1</D:displayname>
 </D:prop>
</D:set>
  </D:propertyupdate>

I think this behavior is incorrect and these requests should create/update in sogo_folder_info c_foldername field instead of per-user settings.
https://www.rfc-editor.org/rfc/rfc6352.html#section-6.3.1

There are other thoughts:

If I make MKCALENDAR request under admin account then it correctly sets c_foldername.

MKCALENDAR
<?xml version='1.0'?>
<C:mkcalendar xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
 <D:set>
<D:prop>
 <D:displayname>Cal-1</D:displayname>
</D:prop>
 </D:set>
</C:mkcalendar>

If I make POST user_name/Calendar/createFolder { name: "Cal 1" } then it correctly sets c_foldername and does not add extra values to c_settings.

MKCOL and PROPPATCH on addressbook and calendar collections should work same way.

Steps To Reproduce

Steps to reproduce:

1) Under admin user account perform two CalDAV requests to create address book for other user:
MKCOL https://.../SOGo/dav/user@domain/Contacts/4eaa265a-0e9c-40e5-932e-35728f2b70b0/ HTTP/1.1
<?xml version='1.0'?>
<D:mkcol xmlns:D="DAV:" xmlns:A="urn:ietf:params:xml:ns:carddav">
<D:set>
<D:prop>
<D:resourcetype>
<D:collection/>
<A:addressbook/>
</D:resourcetype>
<D:displayname>Contacts 1</D:displayname>
</D:prop>
</D:set>
</D:mkcol>

PROPPATCH https://.../SOGo/dav/user@domain/Contacts/4eaa265a-0e9c-40e5-932e-35728f2b70b0/ HTTP/1.1
<?xml version='1.0'?>
<D:propertyupdate xmlns:D="DAV:">
<D:set>
<D:prop>
<D:displayname>Contacts 1</D:displayname>
</D:prop>
</D:set>
</D:propertyupdate>

2) Login under user.

Expected results:
Address book name is "Contacts 1"

Actual results:
Address book name is "4eaa265a-0e9c-40e5-932e-35728f2b70b0"

TagsCalDAV, CardDAV

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2022-08-25 08:57 eugenesu New Issue
2022-08-25 08:57 eugenesu Tag Attached: CalDAV
2022-08-25 08:57 eugenesu Tag Attached: CardDAV