Starting to investigate webdav in dmsf
This commit is contained in:
parent
8828594698
commit
83a1613467
1
Gemfile
1
Gemfile
@ -1,6 +1,7 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "zip"
|
||||
gem "dav4rack"
|
||||
|
||||
#Allows --without=xapian
|
||||
group :xapian do
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
1
lib/redmine_dmsf/webdav.rb
Normal file
1
lib/redmine_dmsf/webdav.rb
Normal file
@ -0,0 +1 @@
|
||||
require 'redmine_dmsf/webdav/resource_factory'
|
||||
17
lib/redmine_dmsf/webdav/resource_factory.rb
Normal file
17
lib/redmine_dmsf/webdav/resource_factory.rb
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user