Add private CardDAV synchronization and contact revision recovery
This commit is contained in:
1 parent
433169c7e7
commit
19e12f96a8
32 files changed
+1855
-47
No files matched your search
@@ -40,6 +40,9 @@ func (s *Server) davActor(w http.ResponseWriter, r *http.Request, requested stri
|
||||
}
|
||||
}
|
||||
w.Header().Set("WWW-Authenticate", `Basic realm="PagesWiki CalDAV", charset="UTF-8"`)
|
||||
if requested == "contacts" {
|
||||
w.Header().Set("WWW-Authenticate", `Basic realm="PagesWiki CardDAV", charset="UTF-8"`)
|
||||
}
|
||||
w.WriteHeader(401)
|
||||
return
|
||||
}
|
||||
@@ -87,11 +90,11 @@ func (s *Server) handleDAVHome(w http.ResponseWriter, r *http.Request) {
|
||||
{Space: calNS, Local: "calendar-home-set"}: "<d:href>" + calendarDAV + "</d:href>",
|
||||
}}}
|
||||
rows[0].props[xml.Name{Space: davNS, Local: "current-user-privilege-set"}] = davPrivileges(false)
|
||||
if writable && tasks && scope != "calendar" {
|
||||
if writable && tasks && (scope == "tasks" || scope == "all") {
|
||||
rows[0].props[xml.Name{Space: davNS, Local: "current-user-privilege-set"}] += "<d:privilege><d:bind/></d:privilege>"
|
||||
}
|
||||
if r.Header.Get("Depth") == "1" {
|
||||
if calendars && scope != "tasks" {
|
||||
if calendars && (scope == "calendar" || scope == "all") {
|
||||
repo, err := s.calendars()
|
||||
if err != nil {
|
||||
calendarError(w, err)
|
||||
@@ -108,7 +111,7 @@ func (s *Server) handleDAVHome(w http.ResponseWriter, r *http.Request) {
|
||||
rows = append(rows, row)
|
||||
}
|
||||
}
|
||||
if tasks && scope != "calendar" {
|
||||
if tasks && (scope == "tasks" || scope == "all") {
|
||||
row := taskDAVCollectionRow()
|
||||
title, err := s.store.TaskDAVDefaultTitle(r.Context(), domain, actor)
|
||||
if err != nil {
|
||||
@@ -137,7 +140,7 @@ func davPrivileges(write bool) string {
|
||||
func (s *Server) handleDAVCredentials(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "private, no-store")
|
||||
domain := s.domainUUIDForRequest(r)
|
||||
if !s.systemExtensionEnabled(domain, "organizer.tasks") && !s.systemExtensionEnabled(domain, "organizer.calendar") {
|
||||
if !s.systemExtensionEnabled(domain, "organizer.tasks") && !s.systemExtensionEnabled(domain, "organizer.calendar") && !s.systemExtensionEnabled(domain, "organizer.contacts") {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user