From 35e5cc88f0e77738bbe47a01d4f95bc9ad40f2f0 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Wed, 7 Oct 2020 15:31:03 +0200 Subject: Expose session based authentication through mount point type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_external/lib/Config/ExternalMountPoint.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/files_external/lib/Config/ExternalMountPoint.php') diff --git a/apps/files_external/lib/Config/ExternalMountPoint.php b/apps/files_external/lib/Config/ExternalMountPoint.php index 5c9bbc71e36..1eac000a97f 100644 --- a/apps/files_external/lib/Config/ExternalMountPoint.php +++ b/apps/files_external/lib/Config/ExternalMountPoint.php @@ -24,9 +24,20 @@ namespace OCA\Files_External\Config; use OC\Files\Mount\MountPoint; +use OCA\Files_External\Lib\StorageConfig; +use OCA\Files_External\Lib\Auth\Password\SessionCredentials; class ExternalMountPoint extends MountPoint { + + /** @var StorageConfig */ + protected $storageConfig; + + public function __construct(StorageConfig $storageConfig, $storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) { + $this->storageConfig = $storageConfig; + parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId); + } + public function getMountType() { - return 'external'; + return ($this->storageConfig->getAuthMechanism() instanceof SessionCredentials) ? 'external-session' : 'external'; } } -- cgit v1.2.3