summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/api
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-01 08:54:48 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-01 08:54:48 +0200
commit8f05d4b662e2f0839af46c29ad0a7a4cad88d73a (patch)
treefaa085af15cd9529bc9416e050138360769fb423 /apps/files_sharing/api
parent1469177a3a45ed22b64a7b96f840be917b8aab07 (diff)
parent41a8f45b93a55fe3e72f0700c15ac04db498d839 (diff)
downloadnextcloud-server-8f05d4b662e2f0839af46c29ad0a7a4cad88d73a.tar.gz
nextcloud-server-8f05d4b662e2f0839af46c29ad0a7a4cad88d73a.zip
Merge pull request #16535 from rullzer/ocs_share_api_url
OCS Share API link shares now always have an url
Diffstat (limited to 'apps/files_sharing/api')
-rw-r--r--apps/files_sharing/api/local.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/api/local.php b/apps/files_sharing/api/local.php
index 308965192b9..84a789f26e4 100644
--- a/apps/files_sharing/api/local.php
+++ b/apps/files_sharing/api/local.php
@@ -71,6 +71,10 @@ class Local {
}
$share['icon'] = substr(\OC_Helper::mimetypeIcon($share['mimetype']), 0, -3) . 'svg';
}
+
+ if (!is_null($share['token'])) {
+ $share['url'] = \OC::$server->getURLGenerator()->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $share['token']]);
+ }
}
return new \OC_OCS_Result($shares);
}
@@ -143,6 +147,12 @@ class Local {
if ($shares === null || empty($shares)) {
return new \OC_OCS_Result(null, 404, 'share doesn\'t exist');
} else {
+ foreach ($shares as &$share) {
+ if (!is_null($share['token'])) {
+ $share['url'] = \OC::$server->getURLGenerator()->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $share['token']]);
+ }
+ }
+
return new \OC_OCS_Result($shares);
}
}