summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/getstatuses.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/ajax/getstatuses.php')
-rw-r--r--apps/files_sharing/ajax/getstatuses.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/getstatuses.php b/apps/files_sharing/ajax/getstatuses.php
new file mode 100644
index 00000000000..c1892e7e2a2
--- /dev/null
+++ b/apps/files_sharing/ajax/getstatuses.php
@@ -0,0 +1,25 @@
+<?php
+require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
+
+OCP\JSON::checkAppEnabled('files_sharing');
+OCP\JSON::checkLoggedIn();
+
+$items = array();
+$userDirectory = '/'.OCP\USER::getUser().'/files';
+$dirLength = strlen($userDirectory);
+if ($rows = OC_Share::getMySharedItems()) {
+ for ($i = 0; $i < count($rows); $i++) {
+ $source = $rows[$i]['source'];
+ // Strip out user directory
+ $item = substr($source, $dirLength);
+ if ($rows[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
+ $items[$item] = true;
+ } else {
+ $items[$item] = false;
+ }
+ }
+}
+
+OCP\JSON::success(array('data' => $items));
+
+?> \ No newline at end of file