DMSF doesn't ignore filepattern when LOCK and UNLOCK requests. #1495
This commit is contained in:
parent
0a51b6e556
commit
962c3a8f23
@ -439,6 +439,8 @@ module RedmineDmsf
|
||||
unless exist?
|
||||
# A successful lock request to an unmapped URL MUST result in the creation of a locked (non-collection)
|
||||
# resource with empty content.
|
||||
return NoContent if ignore?
|
||||
|
||||
f = create_empty_file
|
||||
if f
|
||||
scope = "scope_#{args[:scope] || 'exclusive'}".to_sym
|
||||
@ -544,13 +546,8 @@ module RedmineDmsf
|
||||
raise Forbidden
|
||||
end
|
||||
|
||||
# Ignore file name patterns given in the plugin settings
|
||||
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_ignore']
|
||||
pattern = /^(\._|\.DS_Store$|Thumbs.db$)/ if pattern.blank?
|
||||
if basename.match(pattern)
|
||||
Rails.logger.info "#{basename} ignored"
|
||||
return NoContent
|
||||
end
|
||||
return NoContent if ignore?
|
||||
|
||||
reuse_revision = false
|
||||
if exist? # We're over-writing something, so ultimately a new revision
|
||||
f = file
|
||||
@ -798,6 +795,17 @@ module RedmineDmsf
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
||||
def ignore?
|
||||
# Ignore file name patterns given in the plugin settings
|
||||
pattern = Setting.plugin_redmine_dmsf['dmsf_webdav_ignore']
|
||||
pattern = /^(\._|\.DS_Store$|Thumbs.db$)/ if pattern.blank?
|
||||
if basename.match(pattern)
|
||||
Rails.logger.info "#{basename} ignored"
|
||||
return true
|
||||
end
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user