Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old sharing code part 2 #33219

Open
2 of 14 tasks
PVince81 opened this issue Oct 18, 2018 · 1 comment
Open
2 of 14 tasks

Remove old sharing code part 2 #33219

PVince81 opened this issue Oct 18, 2018 · 1 comment

Comments

@PVince81
Copy link
Contributor

PVince81 commented Oct 18, 2018

Part one was #26608.

There are more items to address:

Remaining OC\Share:: methods that need further work for deletion:

  • Share::checkPasswordProtectedShare()

    • lib/public/Share.php|382| public static function checkPasswordProtectedShare(array $linkItem) {
    • lib/public/Share.php|383| return \OC\Share\Share::checkPasswordProtectedShare($linkItem);
    • lib/private/Share/Share.php|505| if ($checkPasswordProtection && !\OCP\Share::checkPasswordProtectedShare($row)) {
    • lib/private/Share/Share.php|2287| public static function checkPasswordProtectedShare(array $linkItem) {
    • depends on Share::getShareByToken()
  • Share::getShareByToken()

    • apps/files_sharing/lib/Helper.php|56| $linkItem = \OCP\Share::getShareByToken($token, !$password);
    • apps3/side/documents/lib/file.php|67| $linkItem = \OCP\Share::getShareByToken($token, false);
    • lib/public/Share.php|187| public static function getShareByToken($token, $checkPasswordProtection = true) {
    • lib/public/Share.php|188| return \OC\Share\Share::getShareByToken($token, $checkPasswordProtection);
    • lib/private/Share/Share.php|490| public static function getShareByToken($token, $checkPasswordProtection = true) {
    • core/ajax/share.php|229| $share = \OCP\Share::getShareByToken($token, false); => move this to share manager
    • adjust Helper.php above to use share manager, or adjust ajax/shareinfo.php instead
    • check "setupFromToken()" which is only used in ajax/shareinfo.php and uses Helper
    • => might need to revive Move setupfromtoken to sharemanager #24383
  • Share::getUsersSharingFile()

    • apps/comments/lib/Activity/Listener.php|98| $users = \array_merge($users, Share::getUsersSharingFile($path, $owner, true, true));
    • apps/systemtags/lib/Activity/Listener.php|171| $users = \array_merge($users, Share::getUsersSharingFile($path, $owner, true, true));
    • apps3/side/activity/lib/FilesHooks.php|191| return Share::getUsersSharingFile($path, $uidOwner, true, true);
    • apps3/side/activity/build/dist/activity/lib/FilesHooks.php|191| return Share::getUsersSharingFile($path, $uidOwner, true, true);
    • lib/public/Share.php|90| public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
    • lib/public/Share.php|91| return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths, $recursive);
    • lib/private/Encryption/File.php|72| $resultForParents = \OCP\Share::getUsersSharingFile($parent, $owner);
    • lib/private/Encryption/File.php|79| $resultForFile = \OCP\Share::getUsersSharingFile($ownerPath, $owner, false, false, false);
    • lib/private/Share/Share.php|131| public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
  • Share::isEnabled()

    • used only in main template, could replace the template code to use appconfig directly
  • Share::isResharingAllowed()

  • apps/files_sharing/lib/External/Storage.php|297| if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) {

    • apps/files_sharing/lib/SharedStorage.php|201| if (\OCP\Util::isSharingDisabledForUser() || !\OC\Share\Share::isResharingAllowed()) {
    • lib/public/Share.php|392| public static function isResharingAllowed() {
    • lib/public/Share.php|393| return \OC\Share\Share::isResharingAllowed();
    • lib/private/Files/FileInfo.php|210| if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) {
    • lib/private/Share/Share.php|1481| public static function isResharingAllowed() {
    • lib/private/Share/Share.php|1800| if (isset($row['permissions']) && (!self::isResharingAllowed() | \OCP\Util::isSharingDisabledForUser())) {
    • lib/private/Share/Share.php|2176| if (self::isResharingAllowed() && (int)$checkReshare['permissions'] & \OCP\Constants::PERMISSION_SHARE) {
    • core/js/config.php|173| 'resharingAllowed' => \OCP\Share::isResharingAllowed(),
  • Share::removeProtocolFromUrl()

    • used in Share::shareItem()
    • used in Share::sendRemoteShare()
    • used in Share::sendRemoteUnshare()
    • used in Share::isSameUserOnSameServer()
    • oh... it's duplicated in many other classes :-(
  • Share::resolveReShare()

  • Share::setSendMailStatus();

    • unused, can be removed
  • Share::unshareItem()

    • lib/private/Share/Share.php|888| self::unshareItem($toDelete, $newParent);
    • lib/private/Share/Share.php|918| self::unshareItem($share);
    • lib/private/Share/Share.php|1398| self::unshareItem($item);
    • lib/private/Share/Share.php|1412| protected static function unshareItem(array $item, $newParent = null) {
    • used in Share::unshare()
    • used in Share::unshareAll()
    • used in Share::getShareByToken() through Share::expireItem()
@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #240 (--- Removed ---), #3260 (- Removed -), #25997 (Shares getting " (2)" appended.), #26497 (ownCloud adds "(2)" to shared folders), and #26608 (Kill some of the old sharing code related to share backends).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants