You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Share.php 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. /**
  31. * Public interface of ownCloud for apps to use.
  32. * Share Class
  33. *
  34. */
  35. // use OCP namespace for all classes that are considered public.
  36. // This means that they should be used by apps instead of the internal ownCloud classes
  37. namespace OCP;
  38. /**
  39. * This class provides the ability for apps to share their content between users.
  40. * Apps must create a backend class that implements OCP\Share_Backend and register it with this class.
  41. *
  42. * It provides the following hooks:
  43. * - post_shared
  44. * @since 5.0.0
  45. * @deprecated 17.0.0
  46. */
  47. class Share extends \OC\Share\Constants {
  48. /**
  49. * Get the item of item type shared with a given user by source
  50. * @param string $itemType
  51. * @param string $itemSource
  52. * @param string $user User to whom the item was shared
  53. * @param string $owner Owner of the share
  54. * @return array Return list of items with file_target, permissions and expiration
  55. * @since 6.0.0 - parameter $owner was added in 8.0.0
  56. * @deprecated 17.0.0
  57. */
  58. public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null) {
  59. return \OC\Share\Share::getItemSharedWithUser($itemType, $itemSource, $user, $owner);
  60. }
  61. /**
  62. * Get the item of item type shared with the current user by source
  63. * @param string $itemType
  64. * @param string $itemSource
  65. * @param int $format (optional) Format type must be defined by the backend
  66. * @param mixed $parameters
  67. * @param bool $includeCollections
  68. * @return array
  69. * @since 5.0.0
  70. * @deprecated 17.0.0
  71. */
  72. public static function getItemSharedWithBySource($itemType, $itemSource, $format = self::FORMAT_NONE,
  73. $parameters = null, $includeCollections = false) {
  74. // not used by any app - only here to not break apps syntax
  75. }
  76. /**
  77. * Based on the given token the share information will be returned - password protected shares will be verified
  78. * @param string $token
  79. * @param bool $checkPasswordProtection
  80. * @return array|bool false will be returned in case the token is unknown or unauthorized
  81. * @since 5.0.0 - parameter $checkPasswordProtection was added in 7.0.0
  82. * @deprecated 17.0.0
  83. */
  84. public static function getShareByToken($token, $checkPasswordProtection = true) {
  85. // not used by any app - only here to not break apps syntax
  86. }
  87. /**
  88. * Get the shared items of item type owned by the current user
  89. * @param string $itemType
  90. * @param int $format (optional) Format type must be defined by the backend
  91. * @param mixed $parameters
  92. * @param int $limit Number of items to return (optional) Returns all by default
  93. * @param bool $includeCollections
  94. * @return mixed Return depends on format
  95. * @since 5.0.0
  96. * @deprecated 17.0.0
  97. */
  98. public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
  99. $limit = -1, $includeCollections = false) {
  100. // only used by AppVNCSafe app (https://github.com/vnc-biz/nextcloud-appvncsafe/issues/2) - only here to not break apps syntax
  101. }
  102. /**
  103. * Get the shared item of item type owned by the current user
  104. * @param string $itemType
  105. * @param string $itemSource
  106. * @param int $format (optional) Format type must be defined by the backend
  107. * @param mixed $parameters
  108. * @param bool $includeCollections
  109. * @return mixed Return depends on format
  110. * @since 5.0.0
  111. * @deprecated 17.0.0
  112. *
  113. * Refactoring notes:
  114. * * defacto $parameters and $format is always the default and therefore is removed in the subsequent call
  115. */
  116. public static function getItemShared($itemType, $itemSource, $format = self::FORMAT_NONE,
  117. $parameters = null, $includeCollections = false) {
  118. return \OC\Share\Share::getItemShared($itemType, $itemSource, self::FORMAT_NONE, null, $includeCollections);
  119. }
  120. /**
  121. * sent status if users got informed by mail about share
  122. * @param string $itemType
  123. * @param string $itemSource
  124. * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK
  125. * @param string $recipient with whom was the item shared
  126. * @param bool $status
  127. * @since 6.0.0 - parameter $originIsSource was added in 8.0.0
  128. * @deprecated 17.0.0
  129. */
  130. public static function setSendMailStatus($itemType, $itemSource, $shareType, $recipient, $status) {
  131. // not used by any app - only here to not break apps syntax
  132. }
  133. }