Commit 1f04f25c authored by Andreas Jung's avatar Andreas Jung

several fixes to support Office 2K

parent 074bc170
......@@ -85,7 +85,7 @@
"""WebDAV support - collection objects."""
__version__='$Revision: 1.20 $'[11:-2]
__version__='$Revision: 1.21 $'[11:-2]
import sys, os, string, Globals, davcmds, Lockable,re
from common import urlfix, rfc1123_date
......
......@@ -85,7 +85,7 @@
"""WebDAV support - null resource objects."""
__version__='$Revision: 1.29 $'[11:-2]
__version__='$Revision: 1.30 $'[11:-2]
import sys, os, string, mimetypes, Globals, davcmds
import Acquisition, OFS.content_types
......@@ -232,7 +232,7 @@ class NullResource(Persistent, Acquisition.Implicit, Resource):
creator = security.getUser()
body = REQUEST.get('BODY', '')
ifhdr = REQUEST.get_header('If', '')
depth = REQUEST.get_header('Depth', 'infinite')
depth = REQUEST.get_header('Depth', 'infinity')
name = self.__name__
parent = self.__parent__
......
......@@ -85,7 +85,7 @@
"""WebDAV support - resource objects."""
__version__='$Revision: 1.45 $'[11:-2]
__version__='$Revision: 1.46 $'[11:-2]
import sys, os, string, mimetypes, davcmds, ExtensionClass, Lockable
from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase
......@@ -181,10 +181,12 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
found = 0; resourcetagged = 0
taglist = IfParser(ifhdr)
for tag in taglist:
if not tag.resource:
# There's no resource (url) with this tag
taglist = map(tokenFinder, tag.list)
wehave = filter(havetag, list)
tag_list = map(tokenFinder, tag.list)
wehave = filter(havetag, tag_list)
if not wehave: continue
if tag.NOTTED: continue
if refresh:
......@@ -193,8 +195,9 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
found = 1; break
elif urlbase(tag.resource) == url:
resourcetagged = 1
taglist = map(tokenFinder, tag.list)
wehave = filter(havetag, taglist)
tag_list = map(tokenFinder, tag.list)
wehave = filter(havetag, tag_list)
if not wehave: continue
if tag.NOTTED: continue
if refresh:
......@@ -300,6 +303,7 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
if parent.manage_delObjects([name],REQUEST=None) is None:
RESPONSE.setStatus(204)
else:
RESPONSE.setStatus(403)
return RESPONSE
......@@ -538,7 +542,7 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
creator = security.getUser()
body = REQUEST.get('BODY', '')
ifhdr = REQUEST.get_header('If', None)
depth = REQUEST.get_header('Depth', 'infinite')
depth = REQUEST.get_header('Depth', 'infinity')
alreadylocked = Lockable.wl_isLocked(self)
if body and alreadylocked:
......
......@@ -85,7 +85,7 @@
"""WebDAV xml request objects."""
__version__='$Revision: 1.13 $'[11:-2]
__version__='$Revision: 1.14 $'[11:-2]
import sys, os, string
from common import absattr, aq_base, urlfix, urlbase
......@@ -226,6 +226,7 @@ class PropFind:
if dflag: ob._p_deactivate()
if not top: return result
result.write('</d:multistatus>')
return result.getvalue()
......@@ -352,7 +353,7 @@ class Lock:
self.scope = 'exclusive'
self.type = 'write'
self.owner = ''
timeout = request.get_header('Timeout', 'Infinite')
timeout = request.get_header('Timeout', 'infinite')
self.timeout = string.strip(string.split(timeout,',')[-1])
self.parse(data)
......@@ -388,6 +389,7 @@ class Lock:
result=None, url=None, top=1):
""" Apply, built for recursion (so that we may lock subitems
of a collection if requested """
if result is None:
result = StringIO()
url = urlfix(self.request['URL'], 'LOCK')
......@@ -401,6 +403,7 @@ class Lock:
lock = LockItem(creator, self.owner, depth, self.timeout,
self.type, self.scope, token)
if token is None: token = lock.getLockToken()
except ValueError, valerrors:
errmsg = "412 Precondition Failed"
except:
......@@ -475,7 +478,8 @@ class Unlock:
method = getattr(obj, 'wl_delLock')
vld = getSecurityManager().validate(None,obj,'wl_delLock',method)
if vld: obj.wl_delLock(token)
else: errmsg = "403 Forbidden"
else:
errmsg = "403 Forbidden"
elif not islockable:
# Only set an error message if the command is being applied
# to a top level object. Otherwise, we're descending a tree
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment