Details

    • Testing Instructions:
      Hide

      Test pre-requisites

      • 1 WebDAV server supporting SSL (HTTPS)
      • 2 WebDAV shares
        • Without authentication
        • With Basic authentication
      • WebDAV repository enabled
      • 4 different WebDAV instances in Moodle:
        • 'WebDAV None' which does not require Auth
        • 'WebDAV None SSL' which does not require authentication but HTTPS
        • 'WebDAV Basic' which requires Basic authentication
        • 'WebDAV Basic SSL' which requires Basic authentication and HTTPS
      • Each share should contain multiple directories, sub directories, and files on every level.
      • Some directories and files must contain non-ascii characters

      Test steps

      1. Go to your private files
      2. Click on add
      3. Navigate to each WebDAV repository
      4. From each of them, make sure:
      • You can navigate in every directory
      • You can download any file
      • Files downloaded are correctly saved (check their content)

      WebDAV Apache configuration file

      This is my configuration for the 2 shares

      /etc/apache2/conf.d/webdav.conf

      Alias /webdav /var/www/webdav
      <Location /webdav>
        Dav On
        AuthType Basic
        AuthName "webdav"
        AuthUserFile /var/www/webdav/passwd.dav
        Require valid-user
       </Location>
       
      Alias /webdav_none /var/www/webdav_none
       <Location /webdav_none>
        Dav On
        Allow from all
        Satisfy any
       </Location>
       
      DavDepthInfinity On

      Show
      Test pre-requisites 1 WebDAV server supporting SSL (HTTPS) 2 WebDAV shares Without authentication With Basic authentication WebDAV repository enabled 4 different WebDAV instances in Moodle: 'WebDAV None' which does not require Auth 'WebDAV None SSL' which does not require authentication but HTTPS 'WebDAV Basic' which requires Basic authentication 'WebDAV Basic SSL' which requires Basic authentication and HTTPS Each share should contain multiple directories, sub directories, and files on every level. Some directories and files must contain non-ascii characters Test steps Go to your private files Click on add Navigate to each WebDAV repository From each of them, make sure : You can navigate in every directory You can download any file Files downloaded are correctly saved (check their content) WebDAV Apache configuration file This is my configuration for the 2 shares /etc/apache2/conf.d/webdav.conf Alias /webdav /var/www/webdav <Location /webdav> Dav On AuthType Basic AuthName "webdav" AuthUserFile /var/www/webdav/passwd.dav Require valid-user </Location>   Alias /webdav_none /var/www/webdav_none <Location /webdav_none> Dav On Allow from all Satisfy any </Location>   DavDepthInfinity On
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-22663-master

      Description

      I've been trying out the various repository plugins and whilst ones such as google docs, flickr seem to work, I can't get the webdav repositories to work.

      I've tried the webdav repository with both my own webdav server and some of the servers listed here but whatever I setup, when trying to access files using the file picker I always get an empty file listing.

      For example, I've accessed http://demo.sabredav.org (id=testuser/passwd=test) from windows explorer and all works fine, but if I setup a repository using those details shown in the screenshot I just get an empty file list when I choose the repository from add files.

        Gliffy Diagrams

        1. patch.txt
          131 kB
          TJ
        2. webdav_ssl_colin.txt
          2 kB
          Colin Campbell
        1. repository_setup.jpg
          30 kB
        2. Selection_002.jpeg
          32 kB
        3. Selection_003.jpeg
          31 kB

          Issue Links

            Activity

            Hide
            dongsheng Dongsheng Cai added a comment -

            Hi, Simon

            The webdav plugin doesn't support digest authentication, so it failed to load file list, thanks for reporting, I will add digest auth support later.

            Show
            dongsheng Dongsheng Cai added a comment - Hi, Simon The webdav plugin doesn't support digest authentication, so it failed to load file list, thanks for reporting, I will add digest auth support later.
            Hide
            shanmer Simon Hanmer added a comment -

            Dongshei,
            thanks for that - should basic authentication work though?

            I've setup a test webdav server with basic authentication on my server - http://webdav.intelligentweb.co.uk/webdav with username of testuser and password of testuser and still see an emptyfile list even though I know there are files there and I can access through a web browser/file browser.

            Show
            shanmer Simon Hanmer added a comment - Dongshei, thanks for that - should basic authentication work though? I've setup a test webdav server with basic authentication on my server - http://webdav.intelligentweb.co.uk/webdav with username of testuser and password of testuser and still see an emptyfile list even though I know there are files there and I can access through a web browser/file browser.
            Hide
            dongsheng Dongsheng Cai added a comment -

            The webdav library we were using are out-dated, not all webdav features are not supported, I am going to add SabreDAV library to moodle, http://code.google.com/p/sabredav/ it looks like a complete and active webdav library.

            Show
            dongsheng Dongsheng Cai added a comment - The webdav library we were using are out-dated, not all webdav features are not supported, I am going to add SabreDAV library to moodle, http://code.google.com/p/sabredav/ it looks like a complete and active webdav library.
            Hide
            dongsheng Dongsheng Cai added a comment -

            researched more on sabredav last week, turn out it is a webdav server implementation, not a client.

            I fixed a few things on the webdav library we are using at the moment, it supports basic authentication only, it will fail to connect to webdav servers which use digest authentication.

            Show
            dongsheng Dongsheng Cai added a comment - researched more on sabredav last week, turn out it is a webdav server implementation, not a client. I fixed a few things on the webdav library we are using at the moment, it supports basic authentication only, it will fail to connect to webdav servers which use digest authentication.
            Hide
            kpence73 Kameron Pence added a comment -

            When or how long as the basic authorization been supported? I use Dreamhost and they only use basic authorization and as of last week, I could not get the webdav repository to work.

            Show
            kpence73 Kameron Pence added a comment - When or how long as the basic authorization been supported? I use Dreamhost and they only use basic authorization and as of last week, I could not get the webdav repository to work.
            Hide
            dongsheng Dongsheng Cai added a comment -

            Hi, Kameron
            it was 24th, Sep, can you share your webdav server with, so I can test it, you can contact me via dongsheng@moodle.com

            Show
            dongsheng Dongsheng Cai added a comment - Hi, Kameron it was 24th, Sep, can you share your webdav server with, so I can test it, you can contact me via dongsheng@moodle.com
            Hide
            dongsheng Dongsheng Cai added a comment -

            Hi, Kameron

            Thanks for your webdav server.

            Fixed a problem of webdav path, can you check your webdav settings in moodle as attached screenshot?

            It works for me now

            Show
            dongsheng Dongsheng Cai added a comment - Hi, Kameron Thanks for your webdav server. Fixed a problem of webdav path, can you check your webdav settings in moodle as attached screenshot? It works for me now
            Hide
            kk20 mark williams added a comment -

            If I try to add a webdav repository (works externally and internally via IE) then I get an "Invalid JSON string" if I try to use the repository (file picker).

            My webdav is HTTPS and on port 8843 so I change the WebDAV type to HTTPS and add 8843 to the server port. All else is laid out in a similar fashion as screenshot 3

            If I return to the webdav settings the HTTPS does not seem to "stick" and returns to HTTP.

            Show
            kk20 mark williams added a comment - If I try to add a webdav repository (works externally and internally via IE) then I get an "Invalid JSON string" if I try to use the repository (file picker). My webdav is HTTPS and on port 8843 so I change the WebDAV type to HTTPS and add 8843 to the server port. All else is laid out in a similar fashion as screenshot 3 If I return to the webdav settings the HTTPS does not seem to "stick" and returns to HTTP.
            Hide
            dongsheng Dongsheng Cai added a comment -

            Hi Mark

            I just fixed the problem of webdav type, can you please send me your webdav login info(dongsheng@moodle.com), I can run some test.

            Thanks

            Show
            dongsheng Dongsheng Cai added a comment - Hi Mark I just fixed the problem of webdav type, can you please send me your webdav login info(dongsheng@moodle.com), I can run some test. Thanks
            Hide
            colin Colin Campbell added a comment -

            Hi Dongsheng,

            I was having a similar problem with a blank file list when attempting to connect over SSL. The problem appears to be that fsockopen requires an "ssl://" prefix on the hostname parameter. At least, that is the only way I could get it to work. I attached the changes that work for me. If there is another way to make this work over SSL, please let me know.

            Thanks.

            Show
            colin Colin Campbell added a comment - Hi Dongsheng, I was having a similar problem with a blank file list when attempting to connect over SSL. The problem appears to be that fsockopen requires an "ssl://" prefix on the hostname parameter. At least, that is the only way I could get it to work. I attached the changes that work for me. If there is another way to make this work over SSL, please let me know. Thanks.
            Hide
            dongsheng Dongsheng Cai added a comment -

            Raise the priority to critical, please put this issue to sprint 9.

            Show
            dongsheng Dongsheng Cai added a comment - Raise the priority to critical, please put this issue to sprint 9.
            Hide
            felicia Felicia Berryman added a comment -

            Is http://tracker.moodle.org/browse/MDL-25425 a dupe of this?

            I did testing on this too and can't get it to work. I was using my webdav space from wikispaces.com. If you create a blog in wikispaces.com, webdav is accessible from BLOGNAME.wikispaces.com/space/dav/. If you use chrome to get there, it even verifies that the standard http and https ports are used in the log-in. I can get to my webdav space just fine using a browser, but not in moodle.

            More comments at http://moodle.org/mod/forum/discuss.php?d=168528

            Also, is there anyway to not have to store the password? If the password must be stored, could it at least be stored encrypted? I could put this request in to a new tracker report if you'd like.

            Show
            felicia Felicia Berryman added a comment - Is http://tracker.moodle.org/browse/MDL-25425 a dupe of this? I did testing on this too and can't get it to work. I was using my webdav space from wikispaces.com. If you create a blog in wikispaces.com, webdav is accessible from BLOGNAME.wikispaces.com/space/dav/. If you use chrome to get there, it even verifies that the standard http and https ports are used in the log-in. I can get to my webdav space just fine using a browser, but not in moodle. More comments at http://moodle.org/mod/forum/discuss.php?d=168528 Also, is there anyway to not have to store the password? If the password must be stored, could it at least be stored encrypted? I could put this request in to a new tracker report if you'd like.
            Hide
            tlogans TJ added a comment -

            What worked for me was changing line 800 in lib/webdavlib.php. The match was looking for "text/xml; charset="utf-8"", but my content-type only returned "text/xml".

            I tried using the aforementioned sabredev repository, but received the message "The requested method PROPFIND is not allowed for the URL...". Perhaps that has to do with the webDAV settings itself?

            Show
            tlogans TJ added a comment - What worked for me was changing line 800 in lib/webdavlib.php. The match was looking for "text/xml; charset="utf-8"", but my content-type only returned "text/xml". I tried using the aforementioned sabredev repository, but received the message "The requested method PROPFIND is not allowed for the URL...". Perhaps that has to do with the webDAV settings itself?
            Hide
            keoghs Sean Keogh added a comment -

            One of our clients, on Moodle 2.1.1+, is having this problem as well. They are hosting the files on IIS using the IIS implementation of webdav, and the files are accessible from a web browser, and windows clients can map a drive to the webdav repository, but Moodle, using the same credentials, just shows an empty file list. Even with debugging at the highest level, no error messages seem to be thrown. This is pretty urgently needed.

            Show
            keoghs Sean Keogh added a comment - One of our clients, on Moodle 2.1.1+, is having this problem as well. They are hosting the files on IIS using the IIS implementation of webdav, and the files are accessible from a web browser, and windows clients can map a drive to the webdav repository, but Moodle, using the same credentials, just shows an empty file list. Even with debugging at the highest level, no error messages seem to be thrown. This is pretty urgently needed.
            Hide
            marxist Tobias Marx added a comment -

            Well, I did my own tests with our Webdav server.
            The only way to connect via SSL is to use ssl://hostname oder tls://hostname in the Moodle configuration. This is clearly stated in fsockopen's docs: http://www.php.net/manual/en/function.fsockopen.php
            Unfortunatly this will still show no files on the Webdav server.
            The server's error logs show: Client sent malformed Host header
            The server's access logs show: "PROPFIND /bscw/bscw.cgi/1036139/ HTTP/1.1" 400 421 "-" "Moodle WebDav Client"

            When I use a unencrypted connection to our Webdav server, everything works just fine!

            I hope this SSL problem will be fixed soon!

            BR

            Show
            marxist Tobias Marx added a comment - Well, I did my own tests with our Webdav server. The only way to connect via SSL is to use ssl://hostname oder tls://hostname in the Moodle configuration. This is clearly stated in fsockopen's docs: http://www.php.net/manual/en/function.fsockopen.php Unfortunatly this will still show no files on the Webdav server. The server's error logs show: Client sent malformed Host header The server's access logs show: "PROPFIND /bscw/bscw.cgi/1036139/ HTTP/1.1" 400 421 "-" "Moodle WebDav Client" When I use a unencrypted connection to our Webdav server, everything works just fine! I hope this SSL problem will be fixed soon! BR
            Hide
            tsala Helen Foster added a comment -

            Adding labels and fix version and hoping this issue can be investigated soon.

            Show
            tsala Helen Foster added a comment - Adding labels and fix version and hoping this issue can be investigated soon.
            Hide
            ghenrick gavin henrick added a comment -

            Something that may be related, is that it also shows empty for sub folders sometimes even when it can view the files/folders at top level of the webdav connection.

            Show
            ghenrick gavin henrick added a comment - Something that may be related, is that it also shows empty for sub folders sometimes even when it can view the files/folders at top level of the webdav connection.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            For reference, since version 1.5, SabreDAV comes with one DAV client. It's not a finished API but surely better that current client. And also that will provide us with server capabilities for ulterior developments.

            http://code.google.com/p/sabredav/wiki/WebDAVClient

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - For reference, since version 1.5, SabreDAV comes with one DAV client. It's not a finished API but surely better that current client. And also that will provide us with server capabilities for ulterior developments. http://code.google.com/p/sabredav/wiki/WebDAVClient Ciao
            Hide
            matteo Matteo Scaramuccia added a comment - - edited

            Hi Eloy,
            if you're interested in evaluating SabreDAV server features, give DAVRoot a try: https://github.com/scara/moodle-local_davroot#readme.

            HTH,
            Matteo

            Show
            matteo Matteo Scaramuccia added a comment - - edited Hi Eloy, if you're interested in evaluating SabreDAV server features, give DAVRoot a try: https://github.com/scara/moodle-local_davroot#readme . HTH, Matteo
            Hide
            epsd John Stabinger added a comment -

            Tried latest 2.2 and basic auth (no SSL) and no files show up. So, at least for me, it doesn't seem related to SSL or alternate methods of authentication. Tried the patches posted as well and they did not seem to work either.

            Show
            epsd John Stabinger added a comment - Tried latest 2.2 and basic auth (no SSL) and no files show up. So, at least for me, it doesn't seem related to SSL or alternate methods of authentication. Tried the patches posted as well and they did not seem to work either.
            Hide
            mina Nicolas Martignoni added a comment -

            This is very much needed for most WebDAV server. Any progress?

            Show
            mina Nicolas Martignoni added a comment - This is very much needed for most WebDAV server. Any progress?
            Hide
            dmarkwa D. Mark Weiss added a comment - - edited

            We have a need for this soon. Students entering courses in 3 weeks. Teachers do not have access to images they use when developing their courses. We have about 105 courses that need this repository to work. It would be great to get this working.

            Show
            dmarkwa D. Mark Weiss added a comment - - edited We have a need for this soon. Students entering courses in 3 weeks. Teachers do not have access to images they use when developing their courses. We have about 105 courses that need this repository to work. It would be great to get this working.
            Hide
            fred Frédéric Massart added a comment -

            WebDAV had several issues, it was easier to fix them all in this one. Most of the issue in META MDL-29490 will be closed once this one integrated.

            1. (1st commit) I updated the existing 3rd party API to prevent the notices. This fixes the JSON errors from Moodle 2.3.

            2. (2nd commit) The API had to be updated again, there were no way to add support for SSL.

            • Fixed filename cropped due to wrong URL encoding/decoding
            • Fixed support of SSL
            • Fixed ordering of files and folders alphabetically

            3. (3rd commit) Added support for Digest Authentication (in the API again). This could probably be part of another commit/issue, but I'll let you decide if this is really necessary.

            I have created branches for 2.2 and 2.3 too. 2.2 does not support file ordering. If required, this should be implemented in a new issue, or the diffs would differ too much.

            Happy review !

            Show
            fred Frédéric Massart added a comment - WebDAV had several issues, it was easier to fix them all in this one. Most of the issue in META MDL-29490 will be closed once this one integrated. 1. (1st commit) I updated the existing 3rd party API to prevent the notices. This fixes the JSON errors from Moodle 2.3. 2. (2nd commit) The API had to be updated again, there were no way to add support for SSL. Fixed filename cropped due to wrong URL encoding/decoding Fixed support of SSL Fixed ordering of files and folders alphabetically 3. (3rd commit) Added support for Digest Authentication (in the API again). This could probably be part of another commit/issue, but I'll let you decide if this is really necessary. I have created branches for 2.2 and 2.3 too. 2.2 does not support file ordering. If required, this should be implemented in a new issue, or the diffs would differ too much. Happy review !
            Hide
            mina Nicolas Martignoni added a comment -

            Just tested your patch. Working with HTTPS WebDav server and basic authentication (sorry, I don't have the other options available on my owncloud server).

            Thanks ! Can't wait the integration of this fix.

            Show
            mina Nicolas Martignoni added a comment - Just tested your patch. Working with HTTPS WebDav server and basic authentication (sorry, I don't have the other options available on my owncloud server). Thanks ! Can't wait the integration of this fix.
            Hide
            fred Frédéric Massart added a comment -

            Thanks for testing the patch Nicolas.

            Jason, I have taken you remarks in consideration and updated the branches. I have also filed a new issue (MDL-34715) to implement the Digest support. Thanks!

            Show
            fred Frédéric Massart added a comment - Thanks for testing the patch Nicolas. Jason, I have taken you remarks in consideration and updated the branches. I have also filed a new issue ( MDL-34715 ) to implement the Digest support. Thanks!
            Hide
            phalacee Jason Fowler added a comment -

            looks fine Fred

            Show
            phalacee Jason Fowler added a comment - looks fine Fred
            Hide
            nebgor Aparup Banerjee added a comment -

            Hi Fred,
            Thanks for this, its definitely an improvement .

            By your point 3 - i suppose you are refferring to MDL-34715 which i'll look at shortly.

            have noted that only auth:none wasn't working for me but works for you. We'll leave that to proper testing then.

            Perhaps link any MDL-29490 more subtasks as 'will be resolved by' from them to here - this way even if we forget to close there'll be a link to relate them. (done for MDL-25425)

            integrated into 22, 23 and master!

            Show
            nebgor Aparup Banerjee added a comment - Hi Fred, Thanks for this, its definitely an improvement . By your point 3 - i suppose you are refferring to MDL-34715 which i'll look at shortly. have noted that only auth:none wasn't working for me but works for you. We'll leave that to proper testing then. Perhaps link any MDL-29490 more subtasks as 'will be resolved by' from them to here - this way even if we forget to close there'll be a link to relate them. (done for MDL-25425 ) integrated into 22, 23 and master!
            Hide
            salvetore Michael de Raadt added a comment -

            Test result: Success!

            Tested on 2.2, 2.3 and master.

            Show
            salvetore Michael de Raadt added a comment - Test result: Success! Tested on 2.2, 2.3 and master.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Fixed STOP Closed STOP Thanks STOP

            Yay, imagination! Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Fixed STOP Closed STOP Thanks STOP Yay, imagination! Ciao
            Hide
            rkvirani Rahim Virani added a comment -

            Hi All, thanks for your work on this, I dont find that it has been fixed in 2.4 or in the 2.2 (both the latest as of last week). Our institution would really benifit from this plugin as it allows us to pull large media files off of our LMS while still putting them behind authentication and keep them on premise.

            Environment: RHEL for the Moodle Server, IIS 7 for the WebDav server. I checked there are no logs on the Moodle side and the WebDav side reports no errors.

            Show
            rkvirani Rahim Virani added a comment - Hi All, thanks for your work on this, I dont find that it has been fixed in 2.4 or in the 2.2 (both the latest as of last week). Our institution would really benifit from this plugin as it allows us to pull large media files off of our LMS while still putting them behind authentication and keep them on premise. Environment: RHEL for the Moodle Server, IIS 7 for the WebDav server. I checked there are no logs on the Moodle side and the WebDav side reports no errors.
            Hide
            fred Frédéric Massart added a comment -

            Hi Rahim, you might want to follow up on MDL-38718 which seems to be related to your issue/environment.

            Show
            fred Frédéric Massart added a comment - Hi Rahim, you might want to follow up on MDL-38718 which seems to be related to your issue/environment.

              People

              • Votes:
                33 Vote for this issue
                Watchers:
                33 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Sep/12