[api:url] fix #2808 supports onetime url for the external service

Add an option `onetimeUrl` of the volume root option.

`'onetimeUrl' => true`

or

`'onetimeUrl' => function($file, $options, $volumeInstance) { return 'String of onetimeurl'; }``

To enable onetime URL support.
This commit is contained in:
nao-pon
2018-12-30 00:12:22 +09:00
parent 77e961280f
commit 52e365ed23
9 changed files with 248 additions and 107 deletions
+3
View File
@@ -1139,6 +1139,9 @@ class elFinderVolumeBox extends elFinderVolumeDriver
**/
public function getContentUrl($hash, $options = array())
{
if (! empty($options['onetime']) && $this->options['onetimeUrl']) {
return parent::getContentUrl($hash, $options);
}
if (!empty($options['temporary'])) {
// try make temporary file
$url = parent::getContentUrl($hash, $options);