}
break;
case 'getItem':
- if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkShares'])) {
- $reshare = OCP\Share::getItemSharedWithBySource($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true);
- if ($_GET['checkShares'] == "true") {
+ if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkReshare']) && isset($_GET['checkShares'])) {
+ if ($_GET['checkReshare'] == 'true') {
+ $reshare = OCP\Share::getItemSharedWithBySource($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true);
+ } else {
+ $reshare = false;
+ }
+ if ($_GET['checkShares'] == 'true') {
$shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource']);
} else {
$shares = false;
},
loadItem:function(itemType, itemSource) {
var data = '';
+ var checkReshare = true;
// Switch file sources to path to check if status is set
if (itemType == 'file' || itemType == 'folder') {
var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file');
} else {
var item = $('#dir').val() + '/' + filename;
}
+ if (item.substring(0, 8) != '/Shared/') {
+ checkReshare = false;
+ }
} else {
var item = itemSource;
}
} else {
checkShares = true;
}
- $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkShares: checkShares }, async: false, success: function(result) {
+ $.ajax({type: 'GET', url: OC.filePath('core', 'ajax', 'share.php'), data: { fetch: 'getItem', itemType: itemType, itemSource: itemSource, checkReshare: checkReshare, checkShares: checkShares }, async: false, success: function(result) {
if (result && result.status === 'success') {
data = result.data;
} else {