summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/config.php12
-rw-r--r--apps/files_external/lib/storageconfig.php29
2 files changed, 40 insertions, 1 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index deeedb98551..378bedfa8de 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -357,6 +357,9 @@ class OC_Mount_Config {
'applicable' => array('groups' => array($group), 'users' => array()),
'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
);
+ if (isset($mount['mountOptions'])) {
+ $config['mountOptions'] = $mount['mountOptions'];
+ }
$hash = self::makeConfigHash($config);
// If an existing config exists (with same class, mountpoint and options)
if (isset($system[$hash])) {
@@ -393,6 +396,9 @@ class OC_Mount_Config {
'applicable' => array('groups' => array(), 'users' => array($user)),
'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
);
+ if (isset($mount['mountOptions'])) {
+ $config['mountOptions'] = $mount['mountOptions'];
+ }
$hash = self::makeConfigHash($config);
// If an existing config exists (with same class, mountpoint and options)
if (isset($system[$hash])) {
@@ -426,7 +432,7 @@ class OC_Mount_Config {
$mount['class'] = '\OC\Files\Storage\\' . substr($mount['class'], 15);
}
$mount['options'] = self::decryptPasswords($mount['options']);
- $personal[] = array(
+ $config = array(
'id' => (int) $mount['id'],
'storage_id' => (int) $mount['storage_id'],
'class' => $mount['class'],
@@ -436,6 +442,10 @@ class OC_Mount_Config {
'options' => $mount['options'],
'status' => self::getBackendStatus($mount['class'], $mount['options'], true)
);
+ if (isset($mount['mountOptions'])) {
+ $config['mountOptions'] = $mount['mountOptions'];
+ }
+ $personal[] = $config;
}
}
return $personal;
diff --git a/apps/files_external/lib/storageconfig.php b/apps/files_external/lib/storageconfig.php
index f23b5cd86a9..a45321516d4 100644
--- a/apps/files_external/lib/storageconfig.php
+++ b/apps/files_external/lib/storageconfig.php
@@ -54,6 +54,11 @@ class StorageConfig implements \JsonSerializable {
private $applicableGroups = [];
/**
+ * @var array
+ */
+ private $mountOptions = [];
+
+ /**
* @param int|null $id config id or null for a new config
*/
public function __construct($id = null) {
@@ -196,6 +201,27 @@ class StorageConfig implements \JsonSerializable {
}
/**
+ * Returns the mount-specific options
+ *
+ * @return array mount specific options
+ */
+ public function getMountOptions() {
+ return $this->mountOptions;
+ }
+
+ /**
+ * Sets the mount-specific options
+ *
+ * @param array applicable groups
+ */
+ public function setMountOptions($mountOptions) {
+ if (is_null($mountOptions)) {
+ $mountOptions = [];
+ }
+ $this->mountOptions = $mountOptions;
+ }
+
+ /**
* Sets the storage status, whether the config worked last time
*
* @return int $status status
@@ -235,6 +261,9 @@ class StorageConfig implements \JsonSerializable {
if (!empty($this->applicableGroups)) {
$result['applicableGroups'] = $this->applicableGroups;
}
+ if (!empty($this->mountOptions)) {
+ $result['mountOptions'] = $this->mountOptions;
+ }
if (!is_null($this->status)) {
$result['status'] = $this->status;
}