aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/api.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-19 14:39:51 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-19 14:39:51 +0200
commitb947aab80290dc17a50aa714f07bb1981e5307d5 (patch)
tree9dd7996ce6f82d124d077e8db12c59a473fcf1bf /apps/files_sharing/lib/api.php
parent199121134fabb885dce52645b291c82c1bf4c970 (diff)
downloadnextcloud-server-b947aab80290dc17a50aa714f07bb1981e5307d5.tar.gz
nextcloud-server-b947aab80290dc17a50aa714f07bb1981e5307d5.zip
some unit test for the new ocs share api
Diffstat (limited to 'apps/files_sharing/lib/api.php')
-rw-r--r--apps/files_sharing/lib/api.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index 0f9347e34c6..8ed9b4e2345 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -30,7 +30,7 @@ class Api {
* @param array $params option 'file' to limit the result to a specific file/folder
* @return \OC_OCS_Result share information
*/
- public static function getAllShare($params) {
+ public static function getAllShares($params) {
// if a file is specified, get the share for this file
if (isset($_GET['file'])) {
@@ -59,17 +59,17 @@ class Api {
// getAllShare() or we need to translate the shareID to a itemSource
if(isset($params['itemSource'])) {
$itemSource = $params['itemSource'];
- $getAll = true;
+ $getSpecificShare = true;
} else {
$s = self::getShareFromId($params['id']);
$itemSource = $s['item_source'];
- $getAll = false;
+ $getSpecificShare = false;
}
if ($itemSource !== null) {
$shares = \OCP\Share::getItemShared('file', $itemSource);
// if a specific share was specified only return this one
- if ($getAll === false) {
+ if ($getSpecificShare === false) {
foreach ($shares as $share) {
if ($share['id'] === (int)$params['id']) {
$shares = array('element' => $share);
@@ -90,7 +90,7 @@ class Api {
/**
* @breif create a new share
- * @param array $params 'path', 'shareWith', 'shareType'
+ * @param array $params
* @return \OC_OCS_Result
*/
public static function createShare($params) {
@@ -380,6 +380,7 @@ class Api {
* @return string fileID or null
*/
private static function getFileId($path) {
+
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
$fileId = null;