@@ -33,38 +33,38 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | class NodeAddedToCache extends Event { |
| 35 | 35 | |
| 36 | - /** @var IStorage */ |
|
| 37 | - private $storage; |
|
| 36 | + /** @var IStorage */ |
|
| 37 | + private $storage; |
|
| 38 | 38 | |
| 39 | - /** @var string */ |
|
| 40 | - private $path; |
|
| 39 | + /** @var string */ |
|
| 40 | + private $path; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * @param IStorage $storage |
|
| 44 | - * @param string $path |
|
| 45 | - * @since 18.0.0 |
|
| 46 | - */ |
|
| 47 | - public function __construct(IStorage $storage, |
|
| 48 | - string $path) { |
|
| 49 | - parent::__construct(); |
|
| 50 | - $this->storage = $storage; |
|
| 51 | - $this->path = $path; |
|
| 52 | - } |
|
| 42 | + /** |
|
| 43 | + * @param IStorage $storage |
|
| 44 | + * @param string $path |
|
| 45 | + * @since 18.0.0 |
|
| 46 | + */ |
|
| 47 | + public function __construct(IStorage $storage, |
|
| 48 | + string $path) { |
|
| 49 | + parent::__construct(); |
|
| 50 | + $this->storage = $storage; |
|
| 51 | + $this->path = $path; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @return IStorage |
|
| 56 | - * @since 18.0.0 |
|
| 57 | - */ |
|
| 58 | - public function getStorage(): IStorage { |
|
| 59 | - return $this->storage; |
|
| 60 | - } |
|
| 54 | + /** |
|
| 55 | + * @return IStorage |
|
| 56 | + * @since 18.0.0 |
|
| 57 | + */ |
|
| 58 | + public function getStorage(): IStorage { |
|
| 59 | + return $this->storage; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * @return string |
|
| 64 | - * @since 18.0.0 |
|
| 65 | - */ |
|
| 66 | - public function getPath(): string { |
|
| 67 | - return $this->path; |
|
| 68 | - } |
|
| 62 | + /** |
|
| 63 | + * @return string |
|
| 64 | + * @since 18.0.0 |
|
| 65 | + */ |
|
| 66 | + public function getPath(): string { |
|
| 67 | + return $this->path; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | 70 | } |
@@ -34,22 +34,22 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | class ShareCreatedEvent extends Event { |
| 36 | 36 | |
| 37 | - /** @var IShare */ |
|
| 38 | - private $share; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @since 18.0.0 |
|
| 42 | - */ |
|
| 43 | - public function __construct(IShare $share) { |
|
| 44 | - parent::__construct(); |
|
| 45 | - |
|
| 46 | - $this->share = $share; |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * @since 18.0.0 |
|
| 51 | - */ |
|
| 52 | - public function getShare(): IShare { |
|
| 53 | - return $this->share; |
|
| 54 | - } |
|
| 37 | + /** @var IShare */ |
|
| 38 | + private $share; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @since 18.0.0 |
|
| 42 | + */ |
|
| 43 | + public function __construct(IShare $share) { |
|
| 44 | + parent::__construct(); |
|
| 45 | + |
|
| 46 | + $this->share = $share; |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @since 18.0.0 |
|
| 51 | + */ |
|
| 52 | + public function getShare(): IShare { |
|
| 53 | + return $this->share; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -37,47 +37,47 @@ |
||
| 37 | 37 | |
| 38 | 38 | class AcceptController extends Controller { |
| 39 | 39 | |
| 40 | - /** @var ShareManager */ |
|
| 41 | - private $shareManager; |
|
| 40 | + /** @var ShareManager */ |
|
| 41 | + private $shareManager; |
|
| 42 | 42 | |
| 43 | - /** @var IUserSession */ |
|
| 44 | - private $userSession; |
|
| 43 | + /** @var IUserSession */ |
|
| 44 | + private $userSession; |
|
| 45 | 45 | |
| 46 | - /** @var IURLGenerator */ |
|
| 47 | - private $urlGenerator; |
|
| 46 | + /** @var IURLGenerator */ |
|
| 47 | + private $urlGenerator; |
|
| 48 | 48 | |
| 49 | - public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) { |
|
| 50 | - parent::__construct(Application::APP_ID, $request); |
|
| 49 | + public function __construct(IRequest $request, ShareManager $shareManager, IUserSession $userSession, IURLGenerator $urlGenerator) { |
|
| 50 | + parent::__construct(Application::APP_ID, $request); |
|
| 51 | 51 | |
| 52 | - $this->shareManager = $shareManager; |
|
| 53 | - $this->userSession = $userSession; |
|
| 54 | - $this->urlGenerator = $urlGenerator; |
|
| 55 | - } |
|
| 52 | + $this->shareManager = $shareManager; |
|
| 53 | + $this->userSession = $userSession; |
|
| 54 | + $this->urlGenerator = $urlGenerator; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * @NoAdminRequired |
|
| 59 | - * @NoCSRFRequired |
|
| 60 | - */ |
|
| 61 | - public function accept(string $shareId): Response { |
|
| 62 | - try { |
|
| 63 | - $share = $this->shareManager->getShareById($shareId); |
|
| 64 | - } catch (ShareNotFound $e) { |
|
| 65 | - return new NotFoundResponse(); |
|
| 66 | - } |
|
| 57 | + /** |
|
| 58 | + * @NoAdminRequired |
|
| 59 | + * @NoCSRFRequired |
|
| 60 | + */ |
|
| 61 | + public function accept(string $shareId): Response { |
|
| 62 | + try { |
|
| 63 | + $share = $this->shareManager->getShareById($shareId); |
|
| 64 | + } catch (ShareNotFound $e) { |
|
| 65 | + return new NotFoundResponse(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $user = $this->userSession->getUser(); |
|
| 69 | - if ($user === null) { |
|
| 70 | - return new NotFoundResponse(); |
|
| 71 | - } |
|
| 68 | + $user = $this->userSession->getUser(); |
|
| 69 | + if ($user === null) { |
|
| 70 | + return new NotFoundResponse(); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - try { |
|
| 74 | - $share = $this->shareManager->acceptShare($share, $user->getUID()); |
|
| 75 | - } catch (\Exception $e) { |
|
| 76 | - // Just ignore |
|
| 77 | - } |
|
| 73 | + try { |
|
| 74 | + $share = $this->shareManager->acceptShare($share, $user->getUID()); |
|
| 75 | + } catch (\Exception $e) { |
|
| 76 | + // Just ignore |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - $url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); |
|
| 79 | + $url = $this->urlGenerator->linkToRouteAbsolute('files.viewcontroller.showFile', ['fileid' => $share->getNode()->getId()]); |
|
| 80 | 80 | |
| 81 | - return new RedirectResponse($url); |
|
| 82 | - } |
|
| 81 | + return new RedirectResponse($url); |
|
| 82 | + } |
|
| 83 | 83 | } |
@@ -34,36 +34,36 @@ |
||
| 34 | 34 | |
| 35 | 35 | class CSRFTokenController extends Controller { |
| 36 | 36 | |
| 37 | - /** @var CsrfTokenManager */ |
|
| 38 | - private $tokenManager; |
|
| 37 | + /** @var CsrfTokenManager */ |
|
| 38 | + private $tokenManager; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param string $appName |
|
| 42 | - * @param IRequest $request |
|
| 43 | - * @param CsrfTokenManager $tokenManager |
|
| 44 | - */ |
|
| 45 | - public function __construct(string $appName, IRequest $request, |
|
| 46 | - CsrfTokenManager $tokenManager) { |
|
| 47 | - parent::__construct($appName, $request); |
|
| 48 | - $this->tokenManager = $tokenManager; |
|
| 49 | - } |
|
| 40 | + /** |
|
| 41 | + * @param string $appName |
|
| 42 | + * @param IRequest $request |
|
| 43 | + * @param CsrfTokenManager $tokenManager |
|
| 44 | + */ |
|
| 45 | + public function __construct(string $appName, IRequest $request, |
|
| 46 | + CsrfTokenManager $tokenManager) { |
|
| 47 | + parent::__construct($appName, $request); |
|
| 48 | + $this->tokenManager = $tokenManager; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @NoAdminRequired |
|
| 53 | - * @NoCSRFRequired |
|
| 54 | - * @PublicPage |
|
| 55 | - * @return JSONResponse |
|
| 56 | - */ |
|
| 57 | - public function index(): JSONResponse { |
|
| 58 | - if (!$this->request->passesStrictCookieCheck()) { |
|
| 59 | - return new JSONResponse([], Http::STATUS_FORBIDDEN); |
|
| 60 | - } |
|
| 51 | + /** |
|
| 52 | + * @NoAdminRequired |
|
| 53 | + * @NoCSRFRequired |
|
| 54 | + * @PublicPage |
|
| 55 | + * @return JSONResponse |
|
| 56 | + */ |
|
| 57 | + public function index(): JSONResponse { |
|
| 58 | + if (!$this->request->passesStrictCookieCheck()) { |
|
| 59 | + return new JSONResponse([], Http::STATUS_FORBIDDEN); |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - $requestToken = $this->tokenManager->getToken(); |
|
| 62 | + $requestToken = $this->tokenManager->getToken(); |
|
| 63 | 63 | |
| 64 | - return new JSONResponse([ |
|
| 65 | - 'token' => $requestToken->getEncryptedValue(), |
|
| 66 | - ]); |
|
| 67 | - } |
|
| 64 | + return new JSONResponse([ |
|
| 65 | + 'token' => $requestToken->getEncryptedValue(), |
|
| 66 | + ]); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | 69 | } |
@@ -36,46 +36,46 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | class ExternalShareMenuAction extends SimpleMenuAction { |
| 38 | 38 | |
| 39 | - /** @var string */ |
|
| 40 | - private $owner; |
|
| 39 | + /** @var string */ |
|
| 40 | + private $owner; |
|
| 41 | 41 | |
| 42 | - /** @var string */ |
|
| 43 | - private $displayname; |
|
| 42 | + /** @var string */ |
|
| 43 | + private $displayname; |
|
| 44 | 44 | |
| 45 | - /** @var string */ |
|
| 46 | - private $shareName; |
|
| 45 | + /** @var string */ |
|
| 46 | + private $shareName; |
|
| 47 | 47 | |
| 48 | - /** |
|
| 49 | - * ExternalShareMenuAction constructor. |
|
| 50 | - * |
|
| 51 | - * @param string $label |
|
| 52 | - * @param string $icon |
|
| 53 | - * @param string $owner |
|
| 54 | - * @param string $displayname |
|
| 55 | - * @param string $shareName |
|
| 56 | - * @since 14.0.0 |
|
| 57 | - */ |
|
| 58 | - public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) { |
|
| 59 | - parent::__construct('save', $label, $icon); |
|
| 60 | - $this->owner = $owner; |
|
| 61 | - $this->displayname = $displayname; |
|
| 62 | - $this->shareName = $shareName; |
|
| 63 | - } |
|
| 48 | + /** |
|
| 49 | + * ExternalShareMenuAction constructor. |
|
| 50 | + * |
|
| 51 | + * @param string $label |
|
| 52 | + * @param string $icon |
|
| 53 | + * @param string $owner |
|
| 54 | + * @param string $displayname |
|
| 55 | + * @param string $shareName |
|
| 56 | + * @since 14.0.0 |
|
| 57 | + */ |
|
| 58 | + public function __construct(string $label, string $icon, string $owner, string $displayname, string $shareName) { |
|
| 59 | + parent::__construct('save', $label, $icon); |
|
| 60 | + $this->owner = $owner; |
|
| 61 | + $this->displayname = $displayname; |
|
| 62 | + $this->shareName = $shareName; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @since 14.0.0 |
|
| 67 | - */ |
|
| 68 | - public function render(): string { |
|
| 69 | - return '<li>' . |
|
| 70 | - ' <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' . |
|
| 71 | - '</li>' . |
|
| 72 | - '<li id="external-share-menu-item" class="hidden">' . |
|
| 73 | - ' <span class="menuitem">' . |
|
| 74 | - ' <form class="save-form" action="#">' . |
|
| 75 | - ' <input type="text" id="remote_address" placeholder="[email protected]">' . |
|
| 76 | - ' <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' . |
|
| 77 | - ' </form>' . |
|
| 78 | - ' </span>' . |
|
| 79 | - '</li>'; |
|
| 80 | - } |
|
| 65 | + /** |
|
| 66 | + * @since 14.0.0 |
|
| 67 | + */ |
|
| 68 | + public function render(): string { |
|
| 69 | + return '<li>' . |
|
| 70 | + ' <button id="save-external-share" class="icon ' . Util::sanitizeHTML($this->getIcon()) . '" data-protected="false" data-owner-display-name="' . Util::sanitizeHTML($this->displayname) . '" data-owner="' . Util::sanitizeHTML($this->owner) . '" data-name="' . Util::sanitizeHTML($this->shareName) . '">' . Util::sanitizeHTML($this->getLabel()) . '</button>' . |
|
| 71 | + '</li>' . |
|
| 72 | + '<li id="external-share-menu-item" class="hidden">' . |
|
| 73 | + ' <span class="menuitem">' . |
|
| 74 | + ' <form class="save-form" action="#">' . |
|
| 75 | + ' <input type="text" id="remote_address" placeholder="[email protected]">' . |
|
| 76 | + ' <input type="submit" value=" " id="save-button-confirm" class="icon-confirm" disabled="disabled"></button>' . |
|
| 77 | + ' </form>' . |
|
| 78 | + ' </span>' . |
|
| 79 | + '</li>'; |
|
| 80 | + } |
|
| 81 | 81 | } |
@@ -35,22 +35,22 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | class RegisterChecksEvent extends Event { |
| 37 | 37 | |
| 38 | - /** @var IManager */ |
|
| 39 | - private $manager; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * @since 18.0.0 |
|
| 43 | - */ |
|
| 44 | - public function __construct(IManager $manager) { |
|
| 45 | - parent::__construct(); |
|
| 46 | - |
|
| 47 | - $this->manager = $manager; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @since 18.0.0 |
|
| 52 | - */ |
|
| 53 | - public function registerCheck(ICheck $check): void { |
|
| 54 | - $this->manager->registerCheck($check); |
|
| 55 | - } |
|
| 38 | + /** @var IManager */ |
|
| 39 | + private $manager; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * @since 18.0.0 |
|
| 43 | + */ |
|
| 44 | + public function __construct(IManager $manager) { |
|
| 45 | + parent::__construct(); |
|
| 46 | + |
|
| 47 | + $this->manager = $manager; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @since 18.0.0 |
|
| 52 | + */ |
|
| 53 | + public function registerCheck(ICheck $check): void { |
|
| 54 | + $this->manager->registerCheck($check); |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -35,22 +35,22 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | class RegisterOperationsEvent extends Event { |
| 37 | 37 | |
| 38 | - /** @var IManager */ |
|
| 39 | - private $manager; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * @since 18.0.0 |
|
| 43 | - */ |
|
| 44 | - public function __construct(IManager $manager) { |
|
| 45 | - parent::__construct(); |
|
| 46 | - |
|
| 47 | - $this->manager = $manager; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @since 18.0.0 |
|
| 52 | - */ |
|
| 53 | - public function registerOperation(IOperation $operation): void { |
|
| 54 | - $this->manager->registerOperation($operation); |
|
| 55 | - } |
|
| 38 | + /** @var IManager */ |
|
| 39 | + private $manager; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * @since 18.0.0 |
|
| 43 | + */ |
|
| 44 | + public function __construct(IManager $manager) { |
|
| 45 | + parent::__construct(); |
|
| 46 | + |
|
| 47 | + $this->manager = $manager; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @since 18.0.0 |
|
| 52 | + */ |
|
| 53 | + public function registerOperation(IOperation $operation): void { |
|
| 54 | + $this->manager->registerOperation($operation); |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -35,22 +35,22 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | class RegisterEntitiesEvent extends Event { |
| 37 | 37 | |
| 38 | - /** @var IManager */ |
|
| 39 | - private $manager; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * @since 18.0.0 |
|
| 43 | - */ |
|
| 44 | - public function __construct(IManager $manager) { |
|
| 45 | - parent::__construct(); |
|
| 46 | - |
|
| 47 | - $this->manager = $manager; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @since 18.0.0 |
|
| 52 | - */ |
|
| 53 | - public function registerEntity(IEntity $entity): void { |
|
| 54 | - $this->manager->registerEntity($entity); |
|
| 55 | - } |
|
| 38 | + /** @var IManager */ |
|
| 39 | + private $manager; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * @since 18.0.0 |
|
| 43 | + */ |
|
| 44 | + public function __construct(IManager $manager) { |
|
| 45 | + parent::__construct(); |
|
| 46 | + |
|
| 47 | + $this->manager = $manager; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @since 18.0.0 |
|
| 52 | + */ |
|
| 53 | + public function registerEntity(IEntity $entity): void { |
|
| 54 | + $this->manager->registerEntity($entity); |
|
| 55 | + } |
|
| 56 | 56 | } |
@@ -37,54 +37,54 @@ |
||
| 37 | 37 | class ManuallyLockedException extends LockedException { |
| 38 | 38 | |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * owner of the lock |
|
| 42 | - * |
|
| 43 | - * @var string|null |
|
| 44 | - */ |
|
| 45 | - private $owner = null; |
|
| 40 | + /** |
|
| 41 | + * owner of the lock |
|
| 42 | + * |
|
| 43 | + * @var string|null |
|
| 44 | + */ |
|
| 45 | + private $owner = null; |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * estimated timeout for the lock |
|
| 49 | - * |
|
| 50 | - * @var int |
|
| 51 | - * @since 18.0.0 |
|
| 52 | - */ |
|
| 53 | - private $timeout = -1; |
|
| 47 | + /** |
|
| 48 | + * estimated timeout for the lock |
|
| 49 | + * |
|
| 50 | + * @var int |
|
| 51 | + * @since 18.0.0 |
|
| 52 | + */ |
|
| 53 | + private $timeout = -1; |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * ManuallyLockedException constructor. |
|
| 58 | - * |
|
| 59 | - * @param string $path locked path |
|
| 60 | - * @param \Exception|null $previous previous exception for cascading |
|
| 61 | - * @param string $existingLock |
|
| 62 | - * @param string|null $owner |
|
| 63 | - * @param int $timeout |
|
| 64 | - * |
|
| 65 | - * @since 18.0.0 |
|
| 66 | - */ |
|
| 67 | - public function __construct(string $path, \Exception $previous = null, ?string $existingLock = null, ?string $owner = null, int $timeout = -1) { |
|
| 68 | - parent::__construct($path, $previous, $existingLock); |
|
| 69 | - $this->owner = $owner; |
|
| 70 | - $this->timeout = $timeout; |
|
| 71 | - } |
|
| 56 | + /** |
|
| 57 | + * ManuallyLockedException constructor. |
|
| 58 | + * |
|
| 59 | + * @param string $path locked path |
|
| 60 | + * @param \Exception|null $previous previous exception for cascading |
|
| 61 | + * @param string $existingLock |
|
| 62 | + * @param string|null $owner |
|
| 63 | + * @param int $timeout |
|
| 64 | + * |
|
| 65 | + * @since 18.0.0 |
|
| 66 | + */ |
|
| 67 | + public function __construct(string $path, \Exception $previous = null, ?string $existingLock = null, ?string $owner = null, int $timeout = -1) { |
|
| 68 | + parent::__construct($path, $previous, $existingLock); |
|
| 69 | + $this->owner = $owner; |
|
| 70 | + $this->timeout = $timeout; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * @return int |
|
| 76 | - * @since 18.0.0 |
|
| 77 | - */ |
|
| 78 | - public function getTimeout(): int { |
|
| 79 | - return $this->timeout; |
|
| 80 | - } |
|
| 74 | + /** |
|
| 75 | + * @return int |
|
| 76 | + * @since 18.0.0 |
|
| 77 | + */ |
|
| 78 | + public function getTimeout(): int { |
|
| 79 | + return $this->timeout; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * @return string|null |
|
| 84 | - * @since 18.0.0 |
|
| 85 | - */ |
|
| 86 | - public function getOwner(): ?string { |
|
| 87 | - return $this->owner; |
|
| 88 | - } |
|
| 82 | + /** |
|
| 83 | + * @return string|null |
|
| 84 | + * @since 18.0.0 |
|
| 85 | + */ |
|
| 86 | + public function getOwner(): ?string { |
|
| 87 | + return $this->owner; |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | } |