[CalendarServer-changes] [7233] CalendarServer/trunk/twistedcaldav/resource.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 21 21:07:43 PDT 2011


Revision: 7233
          http://trac.macosforge.org/projects/calendarserver/changeset/7233
Author:   sagen at apple.com
Date:     2011-03-21 21:07:39 -0700 (Mon, 21 Mar 2011)
Log Message:
-----------
Don't advertise directory-gateway if it's been disabled.

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/resource.py

Modified: CalendarServer/trunk/twistedcaldav/resource.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/resource.py	2011-03-22 03:28:29 UTC (rev 7232)
+++ CalendarServer/trunk/twistedcaldav/resource.py	2011-03-22 04:07:39 UTC (rev 7233)
@@ -1806,7 +1806,7 @@
         
         if self.addressBooksEnabled():
             baseProperties += (carddavxml.AddressBookHomeSet.qname(),)
-            if config.DirectoryAddressBook.Enabled:
+            if self.directoryAddressBookEnabled():
                 baseProperties += (carddavxml.DirectoryGateway.qname(),)
 
         if config.EnableDropBox:
@@ -1822,10 +1822,13 @@
 
     def calendarsEnabled(self):
         return config.EnableCalDAV
-    
+
     def addressBooksEnabled(self):
         return config.EnableCardDAV
-    
+
+    def directoryAddressBookEnabled(self):
+        return config.DirectoryAddressBook.Enabled and config.EnableSearchAddressBook
+
     @inlineCallbacks
     def readProperty(self, property, request):
         if type(property) is tuple:
@@ -1899,7 +1902,7 @@
                 returnValue(carddavxml.AddressBookHomeSet(
                     *[davxml.HRef(url) for url in self.addressBookHomeURLs()]
                  ))
-            elif name == "directory-gateway":
+            elif name == "directory-gateway" and self.directoryAddressBookEnabled():
                 returnValue(carddavxml.DirectoryGateway(
                     davxml.HRef.fromString(joinURL("/", config.DirectoryAddressBook.name, "/"))
                 ))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110321/aba21c8d/attachment.html>


More information about the calendarserver-changes mailing list