Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Permit administrator to disable WebDAV on individual repositories. Th…
Browse files Browse the repository at this point in the history
…is is necessary for repositories that depend on session credentials because clients such as Windows default WebDAV do not use sessions.
  • Loading branch information
cdujeu committed Oct 11, 2013
1 parent c8be3cd commit c6c0292
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Expand Up @@ -37,7 +37,7 @@ function getChildren(){
foreach($repos as $repository){
$accessType = $repository->getAccessType();
$driver = AJXP_PluginsService::getInstance()->getPluginByTypeName("access", $accessType);
if(is_a($driver, "AjxpWrapperProvider")){
if (is_a($driver, "AjxpWrapperProvider") && !$repository->getOption("AJXP_WEBDAV_DISABLED")) {
$this->children[$repository->getSlug()] = new Sabre\DAV\SimpleCollection($repository->getSlug());
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.ajaxplorer/ajxp_mixins.xml
Expand Up @@ -15,7 +15,7 @@
<param group="MIXIN_MESSAGE[Repository Commons]" name="DEFAULT_RIGHTS" type="select" choices="r|Read Only,rw|Read and Write,w|Write Only (upload)" label="MIXIN_MESSAGE[Default Rights]" description="MIXIN_MESSAGE[This right pattern (empty, r, or rw) will be applied at user creation for this repository.]" default=""/>
<param group="MIXIN_MESSAGE[Repository Commons]" name="AJXP_SLUG" type="string" label="MIXIN_MESSAGE[Alias]" description="MIXIN_MESSAGE[Alias for replacing the generated unique id of the repository]" mandatory="false" no_templates="true"/>
<param group="MIXIN_MESSAGE[Repository Commons]" name="AJXP_GROUP_PATH_PARAMETER" type="string" label="MIXIN_MESSAGE[Group Path]" description="MIXIN_MESSAGE[Set this repository group owner : only users of this group will see it]" mandatory="false" no_templates="true"/>
<param group="MIXIN_MESSAGE[Repository Commons]" name="AJXP_WEBDAV_DISABLED" type="boolean" label="MIXIN_MESSAGE[Disable WebDAV]" description="MIXIN_MESSAGE[Explicitly disable WebDAV access for this repository.]" mandatory="false" default="false" no_templates="true"/>
<param group="MIXIN_MESSAGE[Repository Commons]" name="AJXP_WEBDAV_DISABLED" type="boolean" label="MIXIN_MESSAGE[Disable WebDAV]" description="MIXIN_MESSAGE[Explicitly disable WebDAV access for this repository.]" mandatory="false" default="false" no_templates="true"/>
</server_settings>
</slug_provider>
<template_provider>
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.conf/class.AbstractConfDriver.php
Expand Up @@ -637,7 +637,7 @@ function switchAction($action, $httpVars, $fileVars)
foreach($repoList as $repoIndex => $repoObject){
$accessType = $repoObject->getAccessType();
$driver = AJXP_PluginsService::getInstance()->getPluginByTypeName("access", $accessType);
if(is_a($driver, "AjxpWrapperProvider") && ($loggedUser->canRead($repoIndex) || $loggedUser->canWrite($repoIndex))){
if (is_a($driver, "AjxpWrapperProvider") && !$repoObject->getOption("AJXP_WEBDAV_DISABLED") && ($loggedUser->canRead($repoIndex) || $loggedUser->canWrite($repoIndex))) {
$davRepos[$repoIndex] = $webdavBaseUrl ."".($repoObject->getSlug()==null?$repoObject->getId():$repoObject->getSlug());
}
}
Expand Down

0 comments on commit c6c0292

Please sign in to comment.