Permalink
Browse files

Small fixes

  • Loading branch information...
1 parent 32cd6cc commit 253f984db8aee32a62b418afefbd52ad72cc2f32 @ghecquet ghecquet committed Jun 28, 2016
@@ -9,8 +9,7 @@
<param name="API_URL" type="string" label="CONF_MESSAGE[API URL]" description="CONF_MESSAGE[API URL]" mandatory="true" default="https://api.dropbox.com/2/"/>
<param name="CONSUMER_KEY" type="string" label="CONF_MESSAGE[Consumer Key]" description="CONF_MESSAGE[Key]" mandatory="true"/>
<param name="CONSUMER_SECRET" type="string" label="CONF_MESSAGE[Consumer Secret]" description="CONF_MESSAGE[Secret]" mandatory="true"/>
- <param name="API_RESOURCES_PATH" type="string" label="CONF_MESSAGE[API Path]" description="CONF_MESSAGE[Real path to the api files]" mandatory="true" default="Resources" />
- <param name="API_RESOURCES_FILE" type="string" label="CONF_MESSAGE[API File]" description="CONF_MESSAGE[File name of the api files]" mandatory="true" default="dropbox.json" />
+ <param name="API_RESOURCES_FILE" type="string" label="CONF_MESSAGE[API File]" description="CONF_MESSAGE[File name of the api files]" default="" />
</server_settings>
<class_definition filename="plugins/access.dropbox/vendor/autoload.php" classname="Pydio\Access\DropBox\Driver"/>
<registry_contributions>
@@ -69,8 +69,14 @@ protected function initRepository(ContextInterface $context)
{
$this->detectStreamWrapper(true);
+ $repository = $context->getRepository();
+ $resourcesFile = $repository->getContextOption($context, "API_RESOURCES_FILE", __DIR__ . "/" . self::RESOURCES_PATH . "/" . self::RESOURCES_FILE);
+
Stream::addContextOption($context, [
- "subscribers" => [new DropBoxSubscriber()]
+ "resources" => $resourcesFile,
+ "subscribers" => [
+ new DropBoxSubscriber()
+ ]
]);
return true;
@@ -11,8 +11,7 @@
<param name="HOST" type="string" label="CONF_MESSAGE[Host]" description="CONF_MESSAGE[Host of the WebDAV server, with http/https and without trailing slash. Can contain user:password too.]" mandatory="true" default="http://webdav.host.com"/>
<param name="PATH" type="string" label="CONF_MESSAGE[Uri]" description="CONF_MESSAGE[Path to the root folder on the server]" mandatory="true"/>
<param name="CHMOD_VALUE" type="string" label="CONF_MESSAGE[File Creation Mask]" description="CONF_MESSAGE[Optionnaly apply a chmod operation. Value must be numeric, like 0777, 0644, etc.]" default="0666"/>
- <param name="API_RESOURCES_PATH" type="string" label="CONF_MESSAGE[API Path]" description="CONF_MESSAGE[Real path to the api files]" mandatory="true" default="Resources" />
- <param name="API_RESOURCES_FILE" type="string" label="CONF_MESSAGE[API File]" description="CONF_MESSAGE[File name of the api files]" mandatory="true" default="dav.json" />
+ <param name="API_RESOURCES_FILE" type="string" label="CONF_MESSAGE[API File]" description="CONF_MESSAGE[File name of the api files]" default="" />
</server_settings>
<registry_contributions>
<external_file filename="plugins/access.fs/fsTemplatePart.xml" include="client_configs/*" exclude=""/>
@@ -372,7 +372,7 @@ public function getContextOption(ContextInterface $ctx, $oName, $default = null)
return InputFilter::securePath($pvalue);
}
}
- if (isSet($this->options[$oName])) {
+ if (isSet($this->options[$oName]) && (!empty($this->options[$oName]) || empty($default))) {
return VarsFilter::filter($this->options[$oName], $ctx);
}
if ($this->inferOptionsFromParent && isset($parentTemplateObject)) {
@@ -226,8 +226,8 @@ public static function createStream($path) {
$repository = $node->getRepository();
$ctx = $node->getContext();
- $useAuthStream = $repository->getContextOption($ctx, "USE_AUTH_STREAM", true);
$useOAuthStream = $repository->getContextOption($ctx, "USE_OAUTH_STREAM", false);
+ $useAuthStream = $repository->getContextOption($ctx, "USE_AUTH_STREAM", !$useOAuthStream);
$nodeStream = Stream::factory($node);
if ($useAuthStream) $nodeStream = new AuthStream($nodeStream, $node);

0 comments on commit 253f984

Please sign in to comment.