]> source.dussan.org Git - nextcloud-server.git/commitdiff
Determine if reshare needs to be checked
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 24 Aug 2012 14:43:42 +0000 (10:43 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Fri, 24 Aug 2012 19:12:16 +0000 (15:12 -0400)
core/ajax/share.php
core/js/share.js

index 04294a36ac09e948e1a154942d24d65f1e9c3c5d..806ca9fb98f3df0a58acd02f3d898475fa941851 100644 (file)
@@ -56,9 +56,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
                        }
                        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;
index 810a4e7c0a5dc027e253c62af77f6288f0fd1a2b..b246849b479d1683ebb3d54b36ad7644c3081b42 100644 (file)
@@ -32,6 +32,7 @@ OC.Share={
        },
        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');
@@ -40,6 +41,9 @@ OC.Share={
                        } else {
                                var item = $('#dir').val() + '/' + filename;
                        }
+                       if (item.substring(0, 8) != '/Shared/') {
+                               checkReshare = false;
+                       }
                } else {
                        var item = itemSource;
                }
@@ -48,7 +52,7 @@ OC.Share={
                } 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 {