diff options
Diffstat (limited to 'apps/files_sharing/lib/helper.php')
-rw-r--r-- | apps/files_sharing/lib/helper.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php index 49546f012a6..34de3a915ab 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -16,7 +16,7 @@ class Helper { public static function setupFromToken($token, $relativePath = null, $password = null) { \OC_User::setIncognitoMode(true); - $linkItem = \OCP\Share::getShareByToken($token); + $linkItem = \OCP\Share::getShareByToken($token, !$password); if($linkItem === false || ($linkItem['item_type'] !== 'file' && $linkItem['item_type'] !== 'folder')) { \OC_Response::setStatus(404); \OC_Log::write('core-preview', 'Passed token parameter is not valid', \OC_Log::DEBUG); @@ -202,4 +202,24 @@ class Helper { return $path; } + + /** + * allow users from other ownCloud instances to mount public links share by this instance + * @return bool + */ + public static function isOutgoingServer2serverShareEnabled() { + $appConfig = \OC::$server->getAppConfig(); + $result = $appConfig->getValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes'); + return ($result === 'yes') ? true : false; + } + + /** + * allow user to mount public links from onther ownClouds + * @return bool + */ + public static function isIncomingServer2serverShareEnabled() { + $appConfig = \OC::$server->getAppConfig(); + $result = $appConfig->getValue('files_sharing', 'incoming_server2server_share_enabled', 'yes'); + return ($result === 'yes') ? true : false; + } } |