2012-05-05 22:56:52 +04:00
|
|
|
<?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;
|
2012-05-11 05:06:45 +04:00
|
|
|
} else if (!isset($items[$item])) {
|
2012-05-05 22:56:52 +04:00
|
|
|
$items[$item] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
OCP\JSON::success(array('data' => $items));
|