Share.php 5.1 KB

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