Starting to investigate webdav in dmsf

This commit is contained in:
Daniel Munn 2012-06-08 13:42:29 +01:00
parent 8828594698
commit 83a1613467
5 changed files with 25 additions and 2 deletions

View File

@ -1,6 +1,7 @@
source "https://rubygems.org"
gem "zip"
gem "dav4rack"
#Allows --without=xapian
group :xapian do

View File

@ -88,6 +88,9 @@ RedmineApp::Application.routes.draw do
post '/dmsf/folders/:id/copy/to', :controller => 'dmsf_folders_copy', :action => 'copy_to'
get '/dmsf/folders/:id/copy', :controller => 'dmsf_folders_copy', :action => 'new'
mount DAV4Rack::Handler.new(
# :root => Rails.root.to_s,
:root_uri_path => "/dmsf/webdav",
:resource_class => RedmineDmsf::Webdav::ResourceFactory
), :at => "/dmsf/webdav"
end

View File

@ -1,6 +1,7 @@
require 'redmine_dmsf/patches/custom_fields_helper'
require 'redmine_dmsf/patches/acts_as_customizable'
require 'redmine_dmsf/patches/project_patch'
require 'redmine_dmsf/webdav'
module RedmineDmsf
end

View File

@ -0,0 +1 @@
require 'redmine_dmsf/webdav/resource_factory'

View File

@ -0,0 +1,17 @@
module RedmineDmsf
module Webdav
class ResourceFactory < DAV4Rack::Resource
def initialize(public_path, path, request, response, options)
super(public_path, path, request, response, options)
if (path == "")
end
end
def authenticate(username, password)
User.try_to_login(username, password) ? true : false
end
end
end
end