summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-12-09 07:53:09 +0100
committerLukas Reschke <lukas@owncloud.com>2015-12-09 08:18:47 +0100
commit025f021fd4e908e9304bda26a9f25d887d25108d (patch)
tree0f0069841e1c246c9613a35c0f9efcb747d0d750 /apps/files_external/lib
parent13993c4a6db83c0a637fc7c20da0470acae47208 (diff)
downloadnextcloud-server-025f021fd4e908e9304bda26a9f25d887d25108d.tar.gz
nextcloud-server-025f021fd4e908e9304bda26a9f25d887d25108d.zip
Remove dead code
Silences two other security warnings, also I cleaned up the PHPDoc a little bit.
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/config.php58
1 files changed, 6 insertions, 52 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 7a869847a63..f29e08dad25 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -90,6 +90,7 @@ class OC_Mount_Config {
$userStoragesService->setUser($user);
foreach ($userGlobalStoragesService->getStorages() as $storage) {
+ /** @var \OCA\Files_external\Lib\StorageConfig $storage */
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
$mountEntry = self::prepareMountPointEntry($storage, false);
foreach ($mountEntry['options'] as &$option) {
@@ -267,26 +268,6 @@ class OC_Mount_Config {
}
/**
- * Write the mount points to the config file
- *
- * @param string|null $user If not null, personal for $user, otherwise system
- * @param array $data Mount points
- */
- public static function writeData($user, $data) {
- if (isset($user)) {
- $file = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json';
- } else {
- $config = \OC::$server->getConfig();
- $datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/');
- $file = $config->getSystemValue('mount_file', $datadir . '/mount.json');
- }
-
- $content = json_encode($data, JSON_PRETTY_PRINT);
- @file_put_contents($file, $content);
- @chmod($file, 0640);
- }
-
- /**
* Get backend dependency message
* TODO: move into AppFramework along with templates
*
@@ -397,39 +378,9 @@ class OC_Mount_Config {
}
/**
- * Merges mount points
- *
- * @param array $data Existing mount points
- * @param array $mountPoint New mount point
- * @param string $mountType
- * @return array
- */
- private static function mergeMountPoints($data, $mountPoint, $mountType) {
- $applicable = key($mountPoint);
- $mountPath = key($mountPoint[$applicable]);
- if (isset($data[$mountType])) {
- if (isset($data[$mountType][$applicable])) {
- // Merge priorities
- if (isset($data[$mountType][$applicable][$mountPath])
- && isset($data[$mountType][$applicable][$mountPath]['priority'])
- && !isset($mountPoint[$applicable][$mountPath]['priority'])
- ) {
- $mountPoint[$applicable][$mountPath]['priority']
- = $data[$mountType][$applicable][$mountPath]['priority'];
- }
- $data[$mountType][$applicable]
- = array_merge($data[$mountType][$applicable], $mountPoint[$applicable]);
- } else {
- $data[$mountType] = array_merge($data[$mountType], $mountPoint);
- }
- } else {
- $data[$mountType] = $mountPoint;
- }
- return $data;
- }
-
- /**
* Returns the encryption cipher
+ *
+ * @return AES
*/
private static function getCipher() {
$cipher = new AES(AES::MODE_CBC);
@@ -441,6 +392,9 @@ class OC_Mount_Config {
* Computes a hash based on the given configuration.
* This is mostly used to find out whether configurations
* are the same.
+ *
+ * @param array $config
+ * @return string
*/
public static function makeConfigHash($config) {
$data = json_encode(