Dav4rack library upgraded to the latest stable version

This commit is contained in:
Karel Pičman 2014-06-17 09:09:28 +02:00
parent a2ee92bac2
commit 1d53518eaa
2 changed files with 8 additions and 9 deletions

View File

@ -4,7 +4,7 @@ gem 'rubyzip', '>= 1.0.0'
gem 'zip-zip' # Just to avoid 'cannot load such file -- zip/zip' error
gem 'simple_enum'
gem 'uuidtools', '~> 2.1.1'
gem 'dav4rack', '=0.2.11'
gem 'dav4rack'
group :production do
gem 'nokogiri', '>= 1.5.10'

View File

@ -1,6 +1,7 @@
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Picman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -38,11 +39,9 @@ module RedmineDmsf
else # We made it all the way to DMSF Data
@resource_c = DmsfResource.new(*args)
end
@resource_c.accessor= self unless @resource_c.nil?
@resource_c.accessor = self if @resource_c
end
def authenticate(username, password)
# Bugfix: Current DAV4Rack (including production) authenticate against ALL requests
# Microsoft Web Client will not attempt any authentication (it'd seem) until it's acknowledged
@ -50,7 +49,7 @@ module RedmineDmsf
# going to fork it to ensure compliance, checking the request method in the authentication
# seems the next best step, if the request method is OPTIONS return true, controller will simply
# call the options method within, which accesses nothing, just returns headers about dav env.
return true if ( @request.request_method.downcase == "options" && ( path == "/" || path.empty? ) )
return true if @request.request_method.downcase == 'options' && (path == '/' || path.empty?)
User.current = User.try_to_login(username, password) || nil
return !User.current.anonymous? unless User.current.nil?
false