1
0

Share.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Björn Schießle <bjoern@schiessle.org>
  7. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Robin McCorkell <robin@mccorkell.me.uk>
  12. * @author Roeland Jago Douma <roeland@famdouma.nl>
  13. * @author Thomas Müller <thomas.mueller@tmit.eu>
  14. *
  15. * @license AGPL-3.0
  16. *
  17. * This code is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU Affero General Public License, version 3,
  19. * as published by the Free Software Foundation.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU Affero General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU Affero General Public License, version 3,
  27. * along with this program. If not, see <http://www.gnu.org/licenses/>
  28. *
  29. */
  30. // use OCP namespace for all classes that are considered public.
  31. // This means that they should be used by apps instead of the internal ownCloud classes
  32. namespace OCP;
  33. /**
  34. * This class provides the ability for apps to share their content between users.
  35. * Apps must create a backend class that implements OCP\Share_Backend and register it with this class.
  36. *
  37. * It provides the following hooks:
  38. * - post_shared
  39. * @since 5.0.0
  40. * @deprecated 17.0.0
  41. */
  42. class Share extends \OC\Share\Constants {
  43. /**
  44. * Get the item of item type shared with a given user by source
  45. * @param string $itemType
  46. * @param string $itemSource
  47. * @param string $user User to whom the item was shared
  48. * @param string $owner Owner of the share
  49. * @return array Return list of items with file_target, permissions and expiration
  50. * @since 6.0.0 - parameter $owner was added in 8.0.0
  51. * @deprecated 17.0.0
  52. */
  53. public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
  54. return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
  55. }
  56. /**
  57. * Get the item of item type shared with the current user by source
  58. * @param string $itemType
  59. * @param string $itemSource
  60. * @param int $format (optional) Format type must be defined by the backend
  61. * @param mixed $parameters
  62. * @param bool $includeCollections
  63. * @return void
  64. * @since 5.0.0
  65. * @deprecated 17.0.0
  66. */
  67. public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
  68. $parameters = null, $includeCollections = false) {
  69. // not used by any app - only here to not break apps syntax
  70. }
  71. /**
  72. * Based on the given token the share information will be returned - password protected shares will be verified
  73. * @param string $token
  74. * @param bool $checkPasswordProtection
  75. * @return void
  76. * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
  77. * @deprecated 17.0.0
  78. */
  79. public static function getShareByToken($token, $checkPasswordProtection = true) {
  80. // not used by any app - only here to not break apps syntax
  81. }
  82. /**
  83. * Get the shared items of item type owned by the current user
  84. * @param string $itemType
  85. * @param int $format (optional) Format type must be defined by the backend
  86. * @param mixed $parameters
  87. * @param int $limit Number of items to return (optional) Returns all by default
  88. * @param bool $includeCollections
  89. * @return void
  90. * @since 5.0.0
  91. * @deprecated 17.0.0
  92. */
  93. public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
  94. $limit = -1, $includeCollections = false) {
  95. // only used by AppVNCSafe app (https://github.com/vnc-biz/nextcloud-appvncsafe/issues/2) - only here to not break apps syntax
  96. }
  97. /**
  98. * Get the shared item of item type owned by the current user
  99. * @param string $itemType
  100. * @param string $itemSource
  101. * @param int $format (optional) Format type must be defined by the backend
  102. * @param mixed $parameters
  103. * @param bool $includeCollections
  104. * @return mixed Return depends on format
  105. * @since 5.0.0
  106. * @deprecated 17.0.0
  107. *
  108. * Refactoring notes:
  109. * * defacto $parameters and $format is always the default and therefore is removed in the subsequent call
  110. */
  111. public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
  112. $parameters = null, $includeCollections = false) {
  113. return \OC\Share\Share::getItemShared($itemType, $itemSource, self::FORMAT_NONE, null, $includeCollections);
  114. }
  115. /**
  116. * sent status if users got informed by mail about share
  117. * @param string $itemType
  118. * @param string $itemSource
  119. * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
  120. * @param string $recipient with whom was the item shared
  121. * @param bool $status
  122. * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
  123. * @deprecated 17.0.0
  124. */
  125. public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
  126. // not used by any app - only here to not break apps syntax
  127. }
  128. }