@@ -126,6 +126,7 @@ |
||
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * @param File $item |
| 129 | + * @param \OCA\Richdocuments\Db\Direct $direct |
|
| 129 | 130 | * @return string|null |
| 130 | 131 | * @throws NotFoundException |
| 131 | 132 | * @throws InvalidPathException |
@@ -27,7 +27,6 @@ |
||
| 27 | 27 | use OCA\Federation\TrustedServers; |
| 28 | 28 | use OCA\Files_Sharing\External\Storage as SharingExternalStorage; |
| 29 | 29 | use OCA\Richdocuments\TokenManager; |
| 30 | -use OCP\AppFramework\Http\RedirectResponse; |
|
| 31 | 30 | use OCP\AppFramework\QueryException; |
| 32 | 31 | use OCP\Files\File; |
| 33 | 32 | use OCP\Files\InvalidPathException; |
@@ -40,6 +40,9 @@ discard block |
||
| 40 | 40 | $this->config = $config; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @return string |
|
| 45 | + */ |
|
| 43 | 46 | public function getAppNamespace($key) { |
| 44 | 47 | if (strpos($key, 'watermark_') === 0) { |
| 45 | 48 | return self::WATERMARK_APP_NAMESPACE; |
@@ -61,7 +64,7 @@ discard block |
||
| 61 | 64 | } |
| 62 | 65 | |
| 63 | 66 | /** |
| 64 | - * @param $key |
|
| 67 | + * @param string $key |
|
| 65 | 68 | * @return array |
| 66 | 69 | */ |
| 67 | 70 | public function getAppValueArray($key) { |
@@ -215,6 +215,9 @@ discard block |
||
| 215 | 215 | return new JSONResponse($response); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | + /** |
|
| 219 | + * @param Wopi $wopi |
|
| 220 | + */ |
|
| 218 | 221 | private function setFederationFileInfo($wopi, $response) { |
| 219 | 222 | $remoteUserId = $wopi->getGuestDisplayname(); |
| 220 | 223 | $cloudID = \OC::$server->getCloudIdManager()->resolveCloudId($remoteUserId); |
@@ -235,6 +238,10 @@ discard block |
||
| 235 | 238 | return $response; |
| 236 | 239 | } |
| 237 | 240 | |
| 241 | + /** |
|
| 242 | + * @param boolean $isPublic |
|
| 243 | + * @param string $userId |
|
| 244 | + */ |
|
| 238 | 245 | private function shouldWatermark($isPublic, $userId, $fileId, Wopi $wopi) { |
| 239 | 246 | if ($this->config->getAppValue(AppConfig::WATERMARK_APP_NAMESPACE, 'watermark_enabled', 'no') === 'no') { |
| 240 | 247 | return false; |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | namespace OCA\Richdocuments\Preview; |
| 23 | 23 | |
| 24 | -use GuzzleHttp\Psr7\LimitStream; |
|
| 25 | 24 | use function GuzzleHttp\Psr7\stream_for; |
| 26 | 25 | use OC\Preview\Provider; |
| 27 | 26 | use OCA\Richdocuments\Capabilities; |
@@ -202,6 +202,9 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $shareToken |
|
| 207 | + */ |
|
| 205 | 208 | public function updateToRemoteToken(Wopi $wopi, $shareToken, $remoteServer, $remoteServerToken, $remoteWopi) { |
| 206 | 209 | $uid = $remoteWopi['editorUid'] . '@' . $remoteServer; |
| 207 | 210 | $wopi->setEditorUid($shareToken); |
@@ -213,6 +216,10 @@ discard block |
||
| 213 | 216 | return $wopi; |
| 214 | 217 | } |
| 215 | 218 | |
| 219 | + /** |
|
| 220 | + * @param string $userId |
|
| 221 | + * @param integer $targetFileId |
|
| 222 | + */ |
|
| 216 | 223 | public function getTokenForTemplate(File $templateFile, $userId, $targetFileId, $direct = false) { |
| 217 | 224 | $owneruid = $userId; |
| 218 | 225 | $editoruid = $userId; |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Behat\Behat\Context\Context; |
| 5 | 5 | use GuzzleHttp\Client; |
| 6 | -use GuzzleHttp\Psr7\Response; |
|
| 7 | 6 | use PHPUnit\Framework\Assert; |
| 8 | 7 | |
| 9 | 8 | class FeatureContext implements Context |
@@ -20,8 +20,6 @@ |
||
| 20 | 20 | use OCP\AppFramework\Http\DataResponse; |
| 21 | 21 | use OCP\AppFramework\Http\JSONResponse; |
| 22 | 22 | use OCP\AppFramework\Http\NotFoundResponse; |
| 23 | -use OCP\Http\Client\IClientService; |
|
| 24 | -use OCP\ICache; |
|
| 25 | 23 | use \OCP\IRequest; |
| 26 | 24 | use \OCP\IL10N; |
| 27 | 25 | use OCA\Richdocuments\AppConfig; |
@@ -62,6 +62,7 @@ |
||
| 62 | 62 | * @param string $serverHost |
| 63 | 63 | * @param string $guestDisplayname |
| 64 | 64 | * @param int $templateDestination |
| 65 | + * @param string $share |
|
| 65 | 66 | * @return Wopi |
| 66 | 67 | */ |
| 67 | 68 | public function generateFileToken($fileId, $owner, $editor, $version, $updatable, $serverHost, $guestDisplayname, $templateDestination = 0, $hideDownload = false, $direct = false, $isRemoteToken = false, $templateId = 0, $share = null) { |