diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-22 11:35:30 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-22 11:57:58 -0400 |
commit | 9699ff03bd1a200fc7f73bb29173169d84009e5d (patch) | |
tree | 6e4ec83186cde8329f0e5c4ee36218359b33a004 /core/ajax | |
parent | 536fbb918919b3eb4c8d58b1d4e540c772353b07 (diff) | |
download | nextcloud-server-9699ff03bd1a200fc7f73bb29173169d84009e5d.tar.gz nextcloud-server-9699ff03bd1a200fc7f73bb29173169d84009e5d.zip |
Revert using item name, no longer allowing the same item source exist for a user
Diffstat (limited to 'core/ajax')
-rw-r--r-- | core/ajax/share.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php index 9376f18e8ad..04294a36ac0 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -24,9 +24,9 @@ OC_JSON::checkLoggedIn(); if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSource'])) { switch ($_POST['action']) { case 'share': - if (isset($_POST['itemName']) && isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { + if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { try { - OCP\Share::shareItem($_POST['itemType'], $_POST['itemName'], $_POST['itemSource'], (int)$_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); + OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], (int)$_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); // TODO May need to return private link OC_JSON::success(); } catch (Exception $exception) { @@ -56,9 +56,9 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } break; case 'getItem': - if (isset($_GET['itemType']) && isset($_GET['itemName']) && isset($_GET['itemSource'])) { - $reshare = OCP\Share::getItemSharedWith($_GET['itemType'], $_GET['itemName'], OCP\Share::FORMAT_NONE, null, true); - if ($_GET['itemSource'] !== false) { + 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") { $shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource']); } else { $shares = false; |