summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-01-20 20:34:34 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2015-01-26 16:58:52 +0100
commit5ba19ba7fcda12e21fe37e8686218122936c9a68 (patch)
tree12b22f6dd3421bc674be128626ed688f9580b2a8 /apps/files_sharing
parent67da1f7e5ac9fc5472b6041dcfdc81a4b8428379 (diff)
downloadnextcloud-server-5ba19ba7fcda12e21fe37e8686218122936c9a68.tar.gz
nextcloud-server-5ba19ba7fcda12e21fe37e8686218122936c9a68.zip
certificate manager should always use a \OC\Files\View otherwise we will get problems for different primary storages
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/external/manager.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php
index 35dcabbe50e..8985aeb3fce 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -42,6 +42,7 @@ class Manager {
* @param \OCP\IDBConnection $connection
* @param \OC\Files\Mount\Manager $mountManager
* @param \OC\Files\Storage\StorageFactory $storageLoader
+ * @param \OC\HTTPHelper $httpHelper
* @param string $uid
*/
public function __construct(\OCP\IDBConnection $connection, \OC\Files\Mount\Manager $mountManager,
@@ -53,6 +54,19 @@ class Manager {
$this->uid = $uid;
}
+ /**
+ * add new server-to-server share
+ *
+ * @param string $remote
+ * @param string $token
+ * @param string $password
+ * @param string $name
+ * @param string $owner
+ * @param boolean $accepted
+ * @param string $user
+ * @param int $remoteId
+ * @return mixed
+ */
public function addShare($remote, $token, $password, $name, $owner, $accepted=false, $user = null, $remoteId = -1) {
$user = $user ? $user : $this->uid;
@@ -174,7 +188,12 @@ class Manager {
return ($result['success'] && $status['ocs']['meta']['statuscode'] === 100);
}
- public static function setup($params) {
+ /**
+ * setup the server-to-server mounts
+ *
+ * @param array $params
+ */
+ public static function setup(array $params) {
$externalManager = new \OCA\Files_Sharing\External\Manager(
\OC::$server->getDatabaseConnection(),
\OC\Files\Filesystem::getMountManager(),
@@ -186,6 +205,12 @@ class Manager {
$externalManager->setupMounts();
}
+ /**
+ * remove '/user/files' from the path and trailing slashes
+ *
+ * @param string $path
+ * @return string
+ */
protected function stripPath($path) {
$prefix = '/' . $this->uid . '/files';
return rtrim(substr($path, strlen($prefix)), '/');