You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
620 B

  1. <?php
  2. require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
  3. OCP\JSON::checkAppEnabled('files_sharing');
  4. OCP\JSON::checkLoggedIn();
  5. $items = array();
  6. $userDirectory = '/'.OCP\USER::getUser().'/files';
  7. $dirLength = strlen($userDirectory);
  8. if ($rows = OC_Share::getMySharedItems()) {
  9. for ($i = 0; $i < count($rows); $i++) {
  10. $source = $rows[$i]['source'];
  11. // Strip out user directory
  12. $item = substr($source, $dirLength);
  13. if ($rows[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
  14. $items[$item] = true;
  15. } else {
  16. $items[$item] = false;
  17. }
  18. }
  19. }
  20. OCP\JSON::success(array('data' => $items));
  21. ?>