Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-12528

webdav patch - use webdav.ini.append.php from siteaccess extensions for folderClassSettings + enhancement

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 3.10.0, 3.9.4, 4.0.0
    • Legacy > WebDAV
    • None

    Description

      1 .If you have multiple site on on ez installation and setup the siteaccesses in extension, the webdav.ini.append.php will ignored.
      But every installation (siteaccess) maybe has it's own FolderClasses Settings.

      The following code fix this

              //load extension siteaccess to get webdaav.ini values for folderClass
              eZExtension::prependExtensionSiteAccesses( $currentSite, false, true, false, false );
              $webDavIni->loadCache( true );
      

      2. enhancement
      If you have several sites / project for different customers on one ez installation you do not want to show all customers which sites are available for webdav - accesses by the root url of webdav.

      To fix this I made a new ini setting in webdav.ini

      # Patch - show webdavrootfolder with all available site only if it is public
      # global webdav.ini.append.php
      # enabled - all available site for webdav will be displayed
      # disabled - sitelist is not shown - only direct access to sitaccess is possible
      #            http://webdav.domain.de/siteaccess_admin
      [GeneralSettings]
      RootFolderPublicVisible=enabled
      

      that will be used in webdav.php:

          // The top/root folder is publicly available (without auth):
          if ( $_SERVER['REQUEST_URI'] == ''  or
               $_SERVER['REQUEST_URI'] == '/' or
               $_SERVER['REQUEST_URI'] == '/webdav.php/' or
               $_SERVER['REQUEST_URI'] == '/webdav.php' )
          {
              // Patch - show webdavrootfolder with all available site only if it is public
              // global webdav.ini.append.php
              // # enabled - all available site for webdav will be displayed
              // # disabled - sitelist is not shown - only direct access to sitaccess is possible
              // #            http://webdav.domain.de/siteaccess_admin
              // [GeneralSettings]
              // RootFolderPublicVisible=enabled
      
              $rootFolderPublicVisible = 'enabled';
              if( $webDavIni->hasVariable( 'GeneralSettings', 'RootFolderPublicVisible' ) )
                  $rootFolderPublicVisible = $webDavIni->variable( 'GeneralSettings', 'RootFolderPublicVisible' );
      
              if( $rootFolderPublicVisible === 'enabled' )
              {
                  $testServer = new eZWebDAVContentServer();
                  $testServer->processClientRequest();
              }
              else
              {
                   header( "HTTP/1.1 403 Forbidden" );
              }
      
          }
      

      So you can choose if you list all available sites or only give direct access e.g. http://webdav.domain.de/siteaccess_admin

      This would be nice to have in the ez core
      Thank's

      Felix

      Attachments

        Activity

          People

            unknown unknown
            4d91e976-d41f-487b-ae85-f7216bd06dac@accounts.ibexa.co Felix Woldt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: